Thanks Sarah.
Best,
Luis
On Wed, Mar 16, 2011 at 1:19 PM, Sarah Goslee wrote:
> On Wed, Mar 16, 2011 at 9:07 AM, Luis Ridao wrote:
>> This is my code:
>>
>> mycols <- rep(NULL, 430) ; mycols[c(1,3:5)] <- rep("numeric", 4) ;
>> mycols[c(2)] <- rep("character",1)
>
> rep(NULL, 430) does not give
On Wed, Mar 16, 2011 at 9:07 AM, Luis Ridao wrote:
> This is my code:
>
> mycols <- rep(NULL, 430) ; mycols[c(1,3:5)] <- rep("numeric", 4) ;
> mycols[c(2)] <- rep("character",1)
rep(NULL, 430) does not give you a vector of length 430; it gives you a NULL
vector, and at the end of this process myc
On Mar 16, 2011, at 8:13 AM, Sarah Goslee wrote:
read.table() looks at the first five rows when determining how many
columns
there are. If there are more columns in row 7 and you do not specify
that in
the read.table() command directly, they will be wrapped to the next
row.
This was disc
This is my code:
mycols <- rep(NULL, 430) ; mycols[c(1,3:5)] <- rep("numeric", 4) ;
mycols[c(2)] <- rep("character",1)
inp <- read.table(myfile, skip=2, colClasses=mycols,fill=T)
head(inp)
Best,
Luis
On Wed, Mar 16, 2011 at 1:03 PM, David Winsemius wrote:
>
> On Mar 16, 2011, at 8:13 AM, Sarah
read.table() looks at the first five rows when determining how many columns
there are. If there are more columns in row 7 and you do not specify that in
the read.table() command directly, they will be wrapped to the next row.
This was discussed on the list within the last couple weeks.
Sarah
On
David,
Thanks for your tip but it seems I'm having problems with the number
of columns R manages to read in. Below it s an example of the data read in:
> inp[1:20,]
V1 V2V3 V4 V5 V6 V7 V8 V9
1 1. log_fy_coff -1.007600 0.119520 1. NA
On Mar 15, 2011, at 1:11 PM, wrote:
I think you need to read an introduction to R.
For starters, read.table returns its results as a value, which you
are not saving.
The probable answer to your question:
Read the whole file with read.table, and select columns you need,
e.g.:
tab <- read.
I think you need to read an introduction to R.
For starters, read.table returns its results as a value, which you are not
saving.
The probable answer to your question:
Read the whole file with read.table, and select columns you need, e.g.:
tab <- read.table(myfile, skip=2)[,1:5]
-Original Mes
8 matches
Mail list logo