[R-sig-Finance] How to get values from dataframe's column conditional on other column

Rob Steele rfin.20.phftt at xoxy.net
Tue Jun 13 20:34:40 CEST 2006


There's more than one way to do it.  My favorite:

df <- data.frame(X = c(0.12, -0.24, 0.34),
                  Y = c(TRUE, TRUE, FALSE))

subset(df, Y, X)



More information about the R-SIG-Finance mailing list