Error: 'factor' is not an exported object from 'namespace:dplyr'

Hi,
I would like to convert a variable from character to a factor.

poziomy <-  paste0("P_", seq(1:11))

data <-  data.frame(sample = rep(poziomy, each = 9))

data$sample <- dplyr::factor(data$sample, levels = poziomy)

I got a following error:

Error: 'factor' is not an exported object from 'namespace:dplyr'

How is this possible and what do I do wrong ? Dplyr version is 1.0.8., Rx64 v. 4.1.1.

factor is a base R function, and there is no dplyr::factor that would supercede it, so therefore remove dplyr:: from before factor(

Thank you , I just don't know why I was thinking that factor() comes from dplyr. My mistake.
Thanks again.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.