[R] create multiple variables loop
jour4life
jour4life at gmail.com
Sun Jul 17 06:58:38 CEST 2011
Hello all,
I am trying to figure out how to construct several new variables without
having to write a code for each one. Specifically, I want to calculate
ratios for several variables. For instance, let's say I have:
df
male1990 male1995 male2000 male2005 female1990 female1995 female2000
female2005
10 11 15 17 15
14 17 20
23 22 25 28 25
22 27 30
32 33 37 36 31
37 37 35
I want to calculate sex ratios for each of the years. Please note that this
is an example. I want to calculate age-specific ratios for 5-year age
groups, meaning that this will create a lot of variables. I am not well
versed with looping functions and would appreciate it if someone provided
some information and guidance as how to approach this.
Thanks very much!
Carlos
--
View this message in context: http://r.789695.n4.nabble.com/create-multiple-variables-loop-tp3672921p3672921.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list