I'm trying to filter email accounts that contain the domain "gmail"
here's how it goes:
library(dplyr)
GMAIL<- read.csv(file.choose())
GMAIL <- data.frame(lapply(GMAIL, as.character), stringsAsFactors=FALSE)
GMAIL2<-GMAIL
GMAIL2 %>%
filter(Email, contains("gmail"))
the error i get is: Error in filter_impl(.data, quo) : Evaluation error: object 'Email' not found.
And my Data "GMAIL" only has one column named "Email"
I would also like to make a new dataset with the filtering result, how can I also accomplish this?
Thx in advance
contains
is not a verb used withinfilter
. Perhaps you meanGMAIL2 %>% filter(grepl("gmail", Email))
? I suggest some of the tutorials/docs at dplyr.tidyverse.org to fine-tune where you use column-finding verbs likecontains
and what can be used withinfilter
. - r2evansfile.choose()
>>> whatever.csv - Nate