Displaying 1 result from an estimated 1 matches for "cau2".
Did you mean:
cap2
2010 Aug 20
0
Reshape package and variable assignment
...there has to be a way for this to be done in a few steps rather than
a separate line of code for each new variable.
Thank you,
Mike
Current method (inefficient): one line per species, example data frame
DF$YP <- with(DF, ifelse(SP1 %in% 'YP', CAU1, ifelse(SP2 %in% 'YP', CAU2,
ifelse(SP3 %in% 'YP', CAU3, 0))))
DF$SMB <- with(DF, ifelse(SP1 %in% 'SMB', CAU1, ifelse(SP2 %in% 'SMB', CAU2,
ifelse(SP3 %in% 'SMB', CAU3, 0))))
DF$LMB <- with(DF, ifelse(SP1 %in% 'LMB', CAU1, ifelse(SP2 %...