[R] scanning data in R
John Kane
jrkrideau at inbox.com
Fri Apr 5 14:54:48 CEST 2013
I did not see a reply to your question. I don't know if you can do it within scan but why not just read in the file and then drop the 21?
dat <- scan("stop.txt", sep = "\t")
dat1 <- dat[dat!= 21]
John Kane
Kingston ON Canada
> -----Original Message-----
> From: jamilnaser79 at gmail.com
> Sent: Wed, 3 Apr 2013 10:33:16 +0100
> To: r-help at r-project.org
> Subject: [R] scanning data in R
>
> Dear R-user,
> May I seek your suggestion. I have a data file 'stop' to be scanned in
> R.
> But I want to ignore one specific number '21' there. Putting differently,
> I
> want to get all numbers in the file except 21. Is there any command to
> achieve it?
>
> --------------------------------------------------------------
>
> b<-scan("F:\\stop.txt")
>
> --------------------------------------------------------------
>
> Many thanks for your kind attention.
>
> Regards,
> Jamil.
> ______________________________________________
> 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.
____________________________________________________________
GET FREE SMILEYS FOR YOUR IM & EMAIL - Learn more at http://www.inbox.com/smileys
Works with AIM®, MSN® Messenger, Yahoo!® Messenger, ICQ®, Google Talk™ and most webmails
More information about the R-help
mailing list