Reputation: 21
I have a pretty huge data frame with a column in which some personal emails are repeated hundred times, such as (please see figure below):
is there a function/package which can handle this automatically?
Thanks!
Upvotes: 2
Views: 27
Reputation: 1810
Just try
x <- c("a","a","b","b","v","w") #your emails
numbers <- as.numeric(as.factor(x))
or
numbers <- match(x,unique(x))
Upvotes: 1