[R] R: rearranging data frame rows
Vittorio
vdemart1 at tin.it
Fri Jun 23 18:25:13 CEST 2006
Have a look at merge.
Ciao
Vittorio
>----Messaggio originale----
>Da:
f.calboli at imperial.ac.uk
>Data: 23-giu-2006 18.10
>A: "r-help"<r-
help at stat.math.ethz.ch>
>Ogg: [R] rearranging data frame rows
>
>Hi
All,
>
>I have two data frames. The first contains data about a number
of individuals,
>coded in the first column with a name, in an order I
find convenient.
>
>The second contains different data about the same
indivduals, in a different
>order. Both data frame have the individual
names in the first column.
>
>I need to reorder the second data frame
so the rows are rearranged in the same
>manner as the fist. How?
>
>I
cannot turn the individual names in a numeric vairable with
>as.numeric
(data1[,1]), because the two data frames are subset of different data,
>so the the factor levels are way off between the two. I think I need
to actually
>use the names as a index.
>
>Cheers,
>
>Fede
>
>--
>Federico C. F. Calboli
>Department of Epidemiology and Public Health
>Imperial College, St Mary's Campus
>Norfolk Place, London W2 1PG
>
>Tel +44 (0)20 7594 1602 Fax (+44) 020 7594 3193
>
>f.calboli [.a.
t] imperial.ac.uk
>f.calboli [.a.t] gmail.com
>
>______________________________________________
>R-help at stat.math.ethz.
ch mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE
do read the posting guide! http://www.R-project.org/posting-guide.html
>
More information about the R-help
mailing list