-
Notifications
You must be signed in to change notification settings - Fork 33
Open
Description
Hi,
According to the book:
map_at(numbers, c(1, 3), sqrt)
will generate the following output.
## [[1]]
## [1] 2.645751
##
## [[2]]
## [1] 8
##
## [[3]]
## [1] 4.358899
##
## [[4]]
## [1] 64
However, the numbers
vector takes values numbers <- c(0, 5, 8, 3, 2, 1)
and the output I get is:
## [[1]]
## [1] 0
##
## [[2]]
## [1] 5
##
## [[3]]
## [1] 2.828427
##
## [[4]]
## [1] 3
##
## [[5]]
## [1] 2
##
## [[6]]
## [1] 1
This does make sense since the square root of 0 is 0 and the square root of 8 is 2.828427.
Looking forward to your response.
Thanks,
Leyla
Metadata
Metadata
Assignees
Labels
No labels