Hello, I have the following task I'd like to accomplish:
A file contains 5 columns of data (several hundred rows), let's call
them a, b, c, d and e (ie these are their column headers)
I also have a set of definitions, e.g.,
f = a + b
g = a * 3
h = c + d
etc.
I would like to write out a new
yourDF - cbind(yourDF, f=yourDF$a+yourDF$b, g=yourDF$a * 3,
h=yourDF$c + yourDF$d)
On Wed, Jun 11, 2008 at 9:26 PM, Esmail Bonakdarian [EMAIL PROTECTED] wrote:
Hello, I have the following task I'd like to accomplish:
A file contains 5 columns of data (several hundred rows), let's call
them a,
Esmail -
Esmail Bonakdarian wrote:
Hello, I have the following task I'd like to accomplish:
A file contains 5 columns of data (several hundred rows), let's call
them a, b, c, d and e (ie these are their column headers)
Are these 5 vectors of data stored in a data.frame? I assume so.
I
Hi Erik,
Erik Iverson wrote:
Esmail -
Are these 5 vectors of data stored in a data.frame? I assume so.
Yes, I do a simple load() call first to read the .rda file ...
test2 - transform(test, d = 2*a + b, e = 3*c)
save(test2, file = test2.Rdata)
Does this help?
Yes it does .. this is
jim holtman wrote:
yourDF - cbind(yourDF, f=yourDF$a+yourDF$b, g=yourDF$a * 3,
h=yourDF$c + yourDF$d)
Thanks Jim, I also learned about the transform() method from Erik
which will also work beautifully.
Esmail
__
R-help@r-project.org mailing list
5 matches
Mail list logo