convert email to lower to get count

I have a very big data of email id like below


now i am trying to create a summary of domain counts, i am trying like below but its very time taking , i am getting count of two domain count for lower case and upper case
domain count
hotmail 1

domain_ct <- df %>% select(Email) %>% filter(! %>% tolower(Email)
domain_ct <-".*@", "",domain_ct$Email )))

getting error
Error in tolower(., Email) : unused argument (Email)

do we have any other solution for this.....

The problem is that tolower takes as its first argument the vector to be changed and when you put it in a chain with %>% you are passing it the data frame produced by filter() and then Email. Try this as your first step.

domain_ct <- df %>% select(Email) %>% filter(! %>%
  mutate(Email = tolower(Email))

Alternately, here is a {base} R solution,

email <- c("",
table(tolower(vapply(strsplit(email, "@"), `[[`, character(1), 2)))
#>           2           2

Created on 2020-09-14 by the reprex package (v0.3.0)

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.