[R] scanning data in R

David L Carlson dcarlson at tamu.edu
Wed Apr 3 18:26:18 CEST 2013


You can certainly do it after scanning all the numbers in with

b <- scan("F:\\stop.txt", what=integer())
b <- b[b!=21]

----------------------------------------------
David L Carlson
Associate Professor of Anthropology
Texas A&M University
College Station, TX 77843-4352

> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of Naser Jamil
> Sent: Wednesday, April 03, 2013 4:33 AM
> To: R help
> 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.



More information about the R-help mailing list