I am getting the above error message when I input the following syntax:
y <- mydata_final_distinct %>%
select(Case_ID,starts_with (Effect_)) %>%
pivot_longer(-Case_ID, names_to='symptoms', values_to=adr) %>%
distinct(Case_ID,'symptoms',adr,.keep_all = TRUE) %>%
count(adr) %>%
arrange(desc(n))
CodePudding user response:
Although it is difficult to troubleshoot without having some of your data, I would first make the library explicit in the function calls, as it may be trying to use select
from another library.
library(dplyr)
library(tidyr)
y <- mydata_final_distinct %>%
dplyr::select(Case_ID, starts_with (Effect_)) %>%
tidyr::pivot_longer(-Case_ID, names_to = 'symptoms', values_to = adr) %>%
dplyr::distinct(Case_ID, 'symptoms', adr, .keep_all = TRUE) %>%
dplyr::count(adr) %>%
dplyr::arrange(desc(n))