Re: [R] cbind in data.frame

2008-08-25 Thread Prof Brian Ripley
I think the issue is that cbind applied to a vector or matrix drops classes. It seems that data.frame() should have been used to combine columns here. On Mon, 25 Aug 2008, Charles Plessy wrote: Le Sun, Aug 24, 2008 at 10:56:43PM -0700, Yuan Jian a écrit : hi, when I used cbind to combine col

Re: [R] cbind in data.frame

2008-08-25 Thread Yuan Jian
lt;[EMAIL PROTECTED]> Subject: Re: [R] cbind in data.frame To: r-help@r-project.org Date: Monday, August 25, 2008, 6:09 AM Le Sun, Aug 24, 2008 at 10:56:43PM -0700, Yuan Jian a écrit : > hi, > when I used cbind to combine columns, some contents of columns has been replaced by > number

Re: [R] cbind in data.frame

2008-08-24 Thread Charles Plessy
Le Sun, Aug 24, 2008 at 10:56:43PM -0700, Yuan Jian a écrit : > hi, > when I used cbind to combine columns, some contents of columns has been > replaced by > number. in the script below, column should be aaa,bbb,ccc but I was given > 1,2,3. > but when I change the column to vector, it gave me cor

[R] cbind in data.frame

2008-08-24 Thread Yuan Jian
hi, when I used cbind to combine columns, some contents of columns has been replaced by number. in the script below, column should be aaa,bbb,ccc but I was given 1,2,3. but when I change the column to vector, it gave me correct contents. can you please tell me why?   > d<-read.table("aaa.txt") >