On Oct 21, 2011, at 2:09 PM, Rich Shepard wrote:

On Fri, 21 Oct 2011, David Winsemius wrote:

The last part ("in the same column") does not make sense, since I was
interpreting the term "parameter" to mean a value in a particular column. Assuming these are R NA's then logical indexing:

with( chemdata, chemdata[!is.na(param1) & !is.na(param2) , ])

David,

 I asked the question improperly. What I should have asked is how to
specify only non-missing values of a parameter to create a new subset.
Example (this includes NA rows):

tds.basin <- subset(chemdata, param == "TDS", select = c(param, quant, \
basin), drop = TRUE)

 When I try to add '!is.na' with the param selection I get errors.

If you do not offer both the code and the verbatim copy of the error there will be very little that we can do to diagnose your problem.


To be as specific as I should have been in my original message, how should
I write the above expression to exclude rows where "TDS" is missing?

First you need to clarify whether "TDS" is the name of a column or a possible value in a column named "param". This whole painful multi- question process would be greatly accelerated if you offered str(chemdata).

--

David Winsemius, MD
West Hartford, CT

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to