I am trying to understand the working of vectors with purrr::map() function. I have a vector c("cat", "fish", "hamster") and I want to convert it into the following output:
[[1]]
[1] "cat" "cat" "cat"
[[2]]
[1] "fish" "fish"
[[3]]
[1] "hamster"
Not sure about which map() function should I use and how to approach it. I find it as repetition of the first element thrice, 2 element twice and 3 third element just once.