Skip to content
Prev 316256 / 398502 Next

Removing values containing a specific character

Hi Yasha,

?I guess you got Uwe's response. 

?I created `df2` with the intention of getting the two results from the original dataset.
For example, after you get the first result
df[,1][grep("@",df$names)]<- "" 
#you can get the second result by:
df[df$names!="",]
?# names???????????? emails
#1?? bob?????? bobj at cup.com
#2?? joe joesmith at gmail.com
#4 emily?? emily2 at yahoo.com

#or
df[grep("\\w+",df$names),]
#? names???????????? emails
#1?? bob?????? bobj at cup.com
#2?? joe joesmith at gmail.com
#4 emily?? emily2 at yahoo.com

But, I am? not sure how this will work over a 5.5 million rows. 
A.K.




----- Original Message -----
From: ypodeswa <ypodeswa at gmail.com>
To: r-help at r-project.org
Cc: 
Sent: Sunday, January 27, 2013 1:11 AM
Subject: Re: [R] Removing values containing a specific character

Actually, it worked perfectly for my sample data, but my actual data has
5.5 million rows, and grep doesn't seem to work with over a million rows.
Any idea on a workaround?
On Sat, Jan 26, 2013 at 9:37 PM, Yasha Podeswa <ypodeswa at gmail.com> wrote:

            
--
View this message in context: http://r.789695.n4.nabble.com/Removing-values-containing-a-specific-character-tp4656744p4656751.html
Sent from the R help mailing list archive at Nabble.com.
??? [[alternative HTML version deleted]]

______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.