[R] Creating new columns inside a loop

From: David L. Van Brunt, Ph.D. <dlvanbrunt_at_gmail.com>
Date: Thu 11 Aug 2005 - 05:50:08 EST


Ok, I know R isn't an optimal environment for looping (or so I've heard) but I have a need to loop through columns of data and create new columns of data based on calculations within rows...

I'm sure there's a help file, but I'm not sure what search terms to use to find it! The problem is that these new columns need to have names that I can later access... Like NewVar1, NewVar2, etc....

In php I'd call this "indirection" but I'm not sure what to call it in R so that I can find instructions on how to create, name, and address the values stored this way...

any gentle nudges in the right direction would be greatly appreciated!

-- 
---------------------------------------
David L. Van Brunt, Ph.D.
mailto:dlvanbrunt@gmail.com

	[[alternative HTML version deleted]]

______________________________________________
R-help@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
Received on Thu Aug 11 05:54:16 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:39:45 EST