s-news
[Top] [All Lists]

data selection

To: Mailing List S+ <s-news@wubios.wustl.edu>
Subject: data selection
From: "Martin H. H. Stevens" <hstevens@rci.rutgers.edu>
Date: Mon, 20 Nov 2000 10:15:41 -0500
Dear S users,
I am grppling with a common problem in data management. It's solution is
one the S indexing will, I am sure, redily take care of. I, however,
cannot twist my mind around the solution.

I have a data set (not a data ;-) ) 40,000 records long, with a factor
with 370 levels. About a dozen or more of the factor levels are bogus
(mistakes) and I would like to exclude a hand full more for other
reasons. How do I select the subset of the original data set that
includes only the approximately 350 levels that I want?  I have set up
another data frame with only the factor levels and a logical vector to
allow me to indicate the "TRUE" and "FALSE" levels. I have tried to
reason this out with match, but can't do it.

Original data frame
Factor    response
1    5.1
1   3.2
1    4.3
2    7.6
...    ...
370    2.8

factor level data frame
Factor
1    T
2    F
...    ...
370 T

Thanks for input
Henry
--
Dr. M. Henry H. Stevens
Postdoctoral Associate
Department of Ecology, Evolution, & Natural Resources
14 College Farm Road
Cook College, Rutgers University
New Brunswick, NJ 08901-8551

email: hstevens@rci.rutgers.edu
phone: 732-932-9631
fax: 732-932-8746



<Prev in Thread] Current Thread [Next in Thread>