Re: [R] NA problem in rbind of an apply summary

2014-12-11 Thread Raffaello Vardavas
Thank you Karim, I'll try that. Thanks! Raff Sent from my iPhone > On Dec 10, 2014, at 1:48 PM, "Karim Mezhoud" wrote: > > Hi, > Could you try rbind.na.R function. > karim > > Ô__ > c/ /'_;kmezhoud > (*) \(*) ⴽⴰⵔⵉⵎ ⵎⴻⵣⵀⵓⴷ > http://bioinformatics.tn/ > > > >> On Wed, Dec 10, 2014

Re: [R] NA problem in rbind of an apply summary

2014-12-10 Thread Karim Mezhoud
Hi, Could you try rbind.na.R function. karim Ô__ c/ /'_;kmezhoud (*) \(*) ⴽⴰⵔⵉⵎ ⵎⴻⵣⵀⵓⴷ http://bioinformatics.tn/ On Wed, Dec 10, 2014 at 10:34 PM, Raffaello Vardavas wrote: > Dear All, > > I have a data fame. Each column has numerical values but some columns may > have NA values. >

[R] NA problem in rbind of an apply summary

2014-12-10 Thread Raffaello Vardavas
Dear All, I have a data fame. Each column has numerical values but some columns may have NA values. I'd like a table showing the summary statistics for each column. This is what I do: I first do the following: apply(df[,metrics],2,summary,na.rm=T) giving: $degree Min. 1st Qu. MedianM

Re: [R] NA problem

2010-09-21 Thread peter dalgaard
On Sep 21, 2010, at 11:28 , Jeff Newmiller wrote: > Short answer: don't do that. > > The format function is for preparing data for output. Do your data > manipulations on a data frame you keep for such use, and only use format to > prepare for output. But isn't that what the OP is doing? It i

Re: [R] NA problem

2010-09-21 Thread David Winsemius
On Sep 21, 2010, at 5:28 AM, Jeff Newmiller wrote: Short answer: don't do that. The format function is for preparing data for output. Do your data manipulations on a data frame you keep for such use, and only use format to prepare for output. That is excellent advice. But to answer the q

Re: [R] NA problem

2010-09-21 Thread Jeff Newmiller
Short answer: don't do that. The format function is for preparing data for output. Do your data manipulations on a data frame you keep for such use, and only use format to prepare for output. "n.via...@libero.it" wrote: >Dear R list >I have a problem with NA, which should be a string, but R s

[R] NA problem

2010-09-21 Thread n.via...@libero.it
Dear R list I have a problem with NA, which should be a string, but R seems that it doesn't recognize it. What I do is first give the format command to my data frame: format.data.frame(mydata,big.mark=" ") so I give a blank as thousand separator. All my records in my data frame become strings

Re: [R] NA problem when use paste function

2008-04-17 Thread Lu, Jiang
Thank you very much, Dr. Ripley. The solution "ifelse()" you provided is exactly what I want. I am so happy this morning for that I recieved your email. Yesterday night I was trying to write a loop to substitute NA. But now I learn that "ifelse()" does a much more efficient work. Really appreciate

Re: [R] NA problem when use paste function

2008-04-16 Thread Prof Brian Ripley
On Wed, 16 Apr 2008, Lu, Jiang wrote: > Dear R helpers, > > I was doing a genetic project with two datasets X and Y. There are > some IDs in both data sets, and others in either data set. I used > "merge(x,y,by="ID",all=TRUE)". The data set Y contains a variable (a > genotype) which is also in dat

[R] NA problem when use paste function

2008-04-16 Thread Lu, Jiang
Dear R helpers, I was doing a genetic project with two datasets X and Y. There are some IDs in both data sets, and others in either data set. I used "merge(x,y,by="ID",all=TRUE)". The data set Y contains a variable (a genotype) which is also in data X. When I merge X with Y, these two variables we