[R] scanning data in R
arun
smartpink111 at yahoo.com
Wed Apr 3 19:00:33 CEST 2013
vec<- scan("stop.txt")
#Read 635 items
vec1<-vec[vec!=21]
length(vec1)
#[1] 584
any(vec1==21)
#[1] FALSE
A.K.
----- Original Message -----
From: Naser Jamil <jamilnaser79 at gmail.com>
To: R help <r-help at r-project.org>
Cc:
Sent: Wednesday, April 3, 2013 5:33 AM
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.
More information about the R-help
mailing list