What have you tried?
What type of file are you trying to import from?
What do you want your data to look like in R?
take a look at ?read.table and ?readLines
On Wed, Mar 28, 2012 at 11:23 AM, joel.green wrote:
> Hey
>
> I am having trouble importing data into R, my data field looks like this
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 r
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-in
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
I require the the number at the start of each line however the text is not
needed, i am struggling to get R to import the data with out changing the
file itself?
how do i impor
4 matches
Mail list logo