[R] write dataframes

Williams, Robin robin.williams at metoffice.gov.uk
Tue Sep 9 14:00:20 CEST 2008


Hi,
Just a thought.
You wrote:
ob1<-object1$ORF
ob2<-object2$ORF
and then use cbind like,
HG<-cbind(on1,ob2)
but there is an error. Is there any other function I can use? 

  If you copied and pasted this from R, then your problem is 
Hg <- cbind(on1,ob2)
  You mean 
Hg <- cbind(ob1,ob2) 
  So perhaps just a typo.    
HTH,
Robin Williams 
Met Office summer intern - Health Forecasting 
robin.williams at metoffice.gov.uk 
-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of Roberto Olivares-Hernández
Sent: Tuesday, September 09, 2008 12:47 PM
To: r-help at r-project.org
Subject: [R] write dataframes

Hi,

After manipulate my data I have ended up with 5 different data frames with different number of observations but the same number of variables (columns)

An example, if I write str(object1), I see this,

data.frame':   47 obs. of  3 variables:
 $ ORF    : Factor w/ 245 levels "YAL038W","YAL054C",..: 10 19 38 39 44 
45 50 51 59 60 ...
 $ mRNA   : num  0.891 1.148 1.202 1.479 1.445 ...
 $ Protein: num  1.230 1.288 1.175 0.724 0.851 ..

str(object2)
'data.frame':   21 obs. of  3 variables:
 $ ORF    : Factor w/ 245 levels "YAL038W","YAL054C",..: 11 25 40 55 66 
78 104 119 141 153 ...
 $ mRNA   : num  0.794 0.741 0.676 1.047 0.912 ...
 $ Protein: num  0.427 0.363 0.468 0.501 0.661 ...

using the  column $ORF from each object , how can I  compose/write the results in a file that contains columns with different length ?

I have tried to generate objects like
ob1<-object1$ORF
ob2<-object2$ORF
and then use cbind like,
HG<-cbind(on1,ob2)
but there is an error. Is there any other function I can use?

Thanks for the help

Roberto

______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list