[R] dataframe conversion

Andy Bunn abunn at whrc.org
Tue Nov 1 17:50:56 CET 2005


> The data structures in R are still very puzzling to me. Can anyone tell 
> me how I can easily convert these two dataframes to one single dataframe 
> with two columns (mean and sd) with 7 rows?
> 
>  > meanprofile
>        V1       V2       V3       V4       V5       V6       V7
> 2292.001 2178.620 1654.310 1784.004 1160.052 1142.061 1046.675
>  > sdprofile
>        V1       V2       V3       V4       V5       V6       V7
> 310.6714 347.2072 197.2464 532.3916 161.2955 227.3634 108.5017

There are several ways to go about this. Here's one:
t(rbind(meanprofile, sdprofile))

?rbind and ?t
HTH, Andy




More information about the R-help mailing list