[prev in list] [next in list] [prev in thread] [next in thread]
List: r-help
Subject: [R] automation question
From: RRRRRRRRRR! <cwalter () usgs ! gov>
Date: 2009-07-31 19:30:37
Message-ID: 24761918.post () talk ! nabble ! com
[Download RAW message or body]
I have columns in two tables that need to be compared in order to get a
statistic. The function calculating the statistic is somers2. Here are the
two columns I must calculate, row by row.
name1 name2
1 Pred_pres_a_indpdt[,3,,] population[,23]
2 Pred_pres_b_indpdt[,3,,] population[,24]
3 Pred_pres_c_indpdt[,3,,] population[,25]
4 Pred_pres_d_indpdt[,3,,] population[,26]
5 Pred_pres_e_indpdt[,3,,] population[,27]
6 Pred_pres_f_indpdt[,3,,] population[,28]
7 Pred_pres_a_indpdt[,4,,] population[,23]
8 Pred_pres_b_indpdt[,4,,] population[,24]
9 Pred_pres_c_indpdt[,4,,] population[,25]
10 Pred_pres_d_indpdt[,4,,] population[,26]
11 Pred_pres_e_indpdt[,4,,] population[,27]
12 Pred_pres_f_indpdt[,4,,] population[,28]
13 Pred_pres_a_indpdt[,5,,] population[,23]
14 Pred_pres_b_indpdt[,5,,] population[,24]
15 Pred_pres_c_indpdt[,5,,] population[,25]
16 Pred_pres_d_indpdt[,5,,] population[,26]
17 Pred_pres_e_indpdt[,5,,] population[,27]
18 Pred_pres_f_indpdt[,5,,] population[,28]
19 Pred_pres_a_indpdt[,8,,] population[,23]
20 Pred_pres_b_indpdt[,8,,] population[,24]
21 Pred_pres_c_indpdt[,8,,] population[,25]
22 Pred_pres_d_indpdt[,8,,] population[,26]
23 Pred_pres_e_indpdt[,8,,] population[,27]
24 Pred_pres_f_indpdt[,8,,] population[,28]
the somers2 function works like this:
somers2(x, y)
for example: somers2(Pred_pres_a_indpdt[,3,,], population[,23])
so somers2 is calculated for each row, with column 1 as x, column 2 as y.
Is there anyway to automate this?
-R
--
View this message in context: http://www.nabble.com/automation-question-tp24761918p24761918.html
Sent from the R help mailing list archive at Nabble.com.
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic