[R] scanning data in R

David Winsemius dwinsemius at comcast.net
Wed Apr 3 20:08:10 CEST 2013


On Apr 3, 2013, at 2:33 AM, Naser Jamil wrote:

> 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")
> 

b<-scan("~/Downloads/stop.txt", na.strings="21")
Read 635 items
> b
  [1] 15 15 16 15 17 16 16 15 17 15 16 17 19 17 19 15 16 16 19 18 19 17 17 19 16 17 16 20 15 16
 [31] 16 15 18 19 17 18 16 18 16 17 NA NA 17 15 15 20 16 20 17 NA 19 15 15 15 18 20 16 17 16 15
snipped remainder

-- 
David Winsemius
Alameda, CA, USA



More information about the R-help mailing list