Displaying 1 result from an estimated 1 matches for "pr1n".
Did you mean:
pr1
2011 Apr 09
1
loop and sapply problem, help need
...depending
upon whether they are 1 or 2 or 3.
For example;
lcd1 <- c(11, 22, 33, 44, 11, 22, 33, 33, 22, 11)
lcd2 <- c(22, 11, 44, 11, 33, 11, 22, 22, 11, 22)
lcd3 <- c(12, 12, 34, 14, 13, 12, 23, 23, 12, 12)
PR1 <- c(1, 2, 3, 2, 1, 1, 1, 2, 3, 1)
with the new
PR1n <- c(11, 11, 34, 11, 11, 22, 33, 22, 12, 11)
# as the first element of this vector is determined by PR1[1] indicator
determines whether to pick lcd1[1] or lcd2[1] or lcd3[1] element
similarly for PR1[2] indicator whether to pick lcd1[2] or lcd2[2] or lcd3[2]
element
The same process need t...