[R] apply problem

2007-04-13 Thread aedin culhane
Dear R-Help I am running apply on a data.frame containing factors and numeric columns. It appears to convert are columns into as.character? Does it convert data.frame into matrix? Is this expected? I wish it to recognise numerical columns and round numbers. Can I use another function instead

Re: [R] apply problem

2007-04-13 Thread Prof Brian Ripley
On Fri, 13 Apr 2007, aedin culhane wrote: Dear R-Help I am running apply on a data.frame containing factors and numeric columns. It appears to convert are columns into as.character? Does it convert data.frame into matrix? Is this expected? I wish it to recognise Yes, and quite explicit on

Re: [R] apply problem

2007-04-13 Thread Stephen Tucker
?apply says If X is not an array but has a dimension attribute, apply attempts to coerce it to an array via as.matrix if it is two-dimensional (e.g., data frames). . . It would probably be easiest with a FOR-LOOP, but you could also try something like the code below (and insert your operations

Re: [R] apply problem

2007-04-13 Thread Seth Falcon
aedin culhane [EMAIL PROTECTED] writes: Dear R-Help I am running apply on a data.frame containing factors and numeric columns. It appears to convert are columns into as.character? Does it convert data.frame into matrix? Is this expected? I wish it to recognise numerical columns and round