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?
See the na.strings argument to scan, and note that it can be a vector (eg
, 3 Apr 2013 10:33:16 +0100
To: r-help@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
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?
-
From: r-help-boun...@r-project.org [mailto:r-help-bounces@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
On 4/3/2013 4: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?
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 jamilnase...@gmail.com
To: R help r-help@r-project.org
Cc:
Sent: Wednesday, April 3, 2013 5:33 AM
Subject: [R] scanning data in R
Dear R
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
] 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
import the data, i have tried using comment.char= , however this
didnt work, any help would be much appreciated thanks
--
View this message in context:
http://r.789695.n4.nabble.com/scanning-data-into-r-tp4513182p4513182.html
Sent from the R help mailing list archive at Nabble.com
Just read into a data.frame with read.table and then subset to use the first
column.
e.g.,
your_desired_data - data.frame(read.table(path_to_file, sep = , fill =
T))
your_desired_data - your_desired_data[,1]
--
View this message in context:
http://r.789695.n4.nabble.com/scanning-data-into-r
On Mar 28, 2012, at 2:23 PM, joel.green wrote:
Hey
I am having trouble importing data into R, my data field looks like
this
21 TEST DATA
32 year:2012
33
34
5
36
read.table(text=21 TEST DATA
+ 32 year:2012
+ 33
+ 34
+ 5
+ 36, fill=TRUE)[1]
V1
1 21
2 32
3 33
4 34
5 5
6 36
I
= , however this
didnt work, any help would be much appreciated thanks
--
View this message in context:
http://r.789695.n4.nabble.com/scanning-data-into-r-tp4513182p4513182.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r
12 matches
Mail list logo