As our IT man is currently on holiday I am not able to upgrade to version
1.9.0(or 1.9.1) at the moment, and I see that the gregmisc library will
not work on earlier versions (I am using 1.8.0). Does anyone have any
other suggestions how I might be able to acheive this?
Thank you
Laura Quinn
Hi Laura,
Off the top of my head I'd suggest something like this (assuming your
data frames are named a and b)
a$ord - 1:nrow(a)
b$ord - (1:nrow(b))*2
c - rbind(a, b)
c - c[order(c$ord), ]
ie. add a new column that has the desired ordering, then join the two
data frames together, then reorder.
or something like
new.frame-rbind(x.frame,y.frame); # A frame of the right size.
new.frame[seq(1,nrow(x.frame),by=2),] - x.frame # Assign every other row
new.frame[seq(2,nrow(x.frame),by=2),] - y.frame # Assign every other row.
-Original Message-
From: Laura Quinn [mailto:[EMAIL
*
Sent: Monday, August 16, 2004 9:55 AM
To: '[EMAIL PROTECTED]'
Subject: Re: [R] Stacking Vectors/Dataframes
or something like
new.frame-rbind(x.frame,y.frame); # A frame of the right size.
new.frame[seq(1,nrow(x.frame),by=2),] - x.frame # Assign every other row
new.frame[seq(2,nrow(x.frame),by=2
Archived versions of gregmisc (and other packages) are available from:
http://cran.r-project.org/src/contrib/Archive/
Download one of the older versions (ie. 0.8.5) and install it from a
console using R CMD INSTALL.
If you are restricted from installing packages to the main R tree (ie.
you do
Laura == Laura Quinn [EMAIL PROTECTED]
on Mon, 16 Aug 2004 14:33:45 +0100 (BST) writes:
Laura As our IT man is currently on holiday I am not able
Laura to upgrade to version 1.9.0(or 1.9.1) at the moment,
Laura and I see that the gregmisc library will not work on
Laura
Yes, make a local installation on your home directory or another machine
which you have write access to.
AFAIK, you cannot update R itself. You will need to install R-1.9.1 and
delete the old version as opposed to upgrading from it. You can try to
salvage the lib directory but it is much better
I believe interleave() in the `gregmisc' package can do what you want.
Cheers,
Andy
From: Laura Quinn
Hello,
Is there a simple way of stacking/merging two dataframes in
R? I want to
stack them piece-wise, not simply add one whole dataframe to
the bottom of
the other. I want to