1

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?

Phil Dukhov
  • 67,741
  • 15
  • 184
  • 220
ZR8
  • 131
  • 1
  • 9

1 Answers1

2

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
  • 16,126
  • 5
  • 18
  • 49