Vote count:
0
I would like to be able to define arguments for dplyr
verbs
filter1<- "!is.na(attend)"
filter2<- "is.na(attend)"
and then use these strings in dply
functions :
ds1<- ds %>%
filter(eval(cat(filter2)))
ds2<- ds %>%
filter(eval(cat(filter1)))
But it throws in error
!is.na(attend)
Error: filter condition does not evaluate to a logical vector.
How to pass a string as an argument in a dplyr
verb?
asked 49 secs ago
Aucun commentaire:
Enregistrer un commentaire