0

I'm running into a problem running the following code:

brazil <- brazil %>% mutate (
  ID = paste0(country, block, respondentID)
)

where I get the error:

Error in mutate(., ID = paste0(country, block, respondentID), BlockID = paste0(country, : could not find function "mutate"

Even though Tidyverse is installed, checked library, etc. Is there something basic I'm missing?

Pylyp Dukhov
  • 38,521
  • 10
  • 57
  • 92
ZR8
  • 51
  • 7

1 Answers1

1

As recommended above, I always make the library explicit in the function call, especially when a function name may collide with other libraries, which could be plyr (or several other packages) in the case of mutate.

library(dplyr)

brazil <- brazil %>%
  dplyr::mutate(ID = paste0(country, block, respondentID))
AndrewGB
  • 12,571
  • 4
  • 13
  • 38