The following code, works perfectly in RStudio IDE but not in my RStudio Cloud project:
library(multcomp)
attach(cholesterol)
chol <- as.data.frame(cholesterol)
chol
detach(cholesterol)
visualizar por tratamiento (columnas)
library(tidyr)
library(dplyr)
tratamientos <- chol %>%
group_by(trt) %>%
mutate(n = row_number()) %>% # para crear valores únicos no lista
pivot_wider(names_from = trt,
values_from = response)
Here is the error:
Error: n() must only be used inside dplyr verbs.
Thanks,
Denny S.