[R] Newbie - referencing and vectorization questions

Debruicker, Paul A pdebruic at mgmt.purdue.edu
Fri Dec 20 22:21:05 CET 2002


Dear List,
 
    I am working on learning R and have come up with a few questions that I haven't been able to answer with books from the local library. I am attempting to find the mean and variance of subsets of a ~140k item vector(lets say variable X). Using groups of 5 variables from a pool of 7, I limit the values of X by only selecting those who remain in the set after sorting on interpercentile ranges of the 5 other variables. There are 21 groups of 5 sorting variables, and if I were to use interquartile ranges, 5^4 possible combinations for each group.  So, I am trying to learn to write fast code, while learning R.
 
My questions are these:
 
     Is there a way to select a vector from a dataframe(containing values of sorting variables) using a character string located in another dataframe (containing possible groups of variables) that has been referenced with a numeric index?
 
     If there is, is there a way to do it using a vectorized process, rather than an iterative with several for loops or something?
 
 
Thanks for your consideration,
 
Paul




More information about the R-help mailing list