[R] Paste Strings as logical for functions?

tsunhin wong thjwong at gmail.com
Fri May 22 02:49:28 CEST 2009


Dear R Users,

I have some dynamic selection rules that I want to pass around for my functions:

>rules <- paste(g$TrialList==1 & g$Session==2)
>myfunction <- function(rules) {
>   index <- which(rules)
>   anotherFunction(index)
> }

However, I can't find a way to pass around these selection rules
easily (for subset, for which, etc)
Please let me know if you have some idea.

Thank you very much!

- John




More information about the R-help mailing list