[R] subset question

Kirsten Beyer kirsten-beyer at uiowa.edu
Mon Aug 27 20:14:12 CEST 2007


I would like to code records in a dataset with a 1 if any of the
columns 9-67 contain a particular code, and zero if they don't.  I've
been working with "subset" and it seems that something like
subset(data, data[9:67]--"12345") would work, but I have been
unsuccessful so far.  It seems like a simple problem - any help is
appreciated!



More information about the R-help mailing list