Of course I left out the "data" argument:

boxplot(Result ~ Chemical, data= yourdat,subset=yourdat$Chemical %in%
c("Ca","Cl", "Cond","Mg","Na","SO2","TDS"))

-- Bert

On Wed, Nov 2, 2011 at 10:08 AM, Bert Gunter <bgun...@gene.com> wrote:

> To make such a plot, I would have thought your want your data structure to
> be:
>
> yourdat:
>
> Column A: Date
> Column B; Chemical
> Column C: Result
> ....
>
> After subsetting this to the chemicals you want or doing the subsetting in
> your plot command, something like (base R)
>
> boxplot(Result ~ Chemical, subset=yourdat$Chemical %in% c("Ca","Cl",
> "Cond","Mg","Na","SO2","TDS"))
>
> You probably can get what you want one way or the other with your current
> data structure -- though you may have to use ggplot or trellis -- but it
> does appear to be inconvenient.
>
> Whether I'm correct or not in my understanding of your situation, an
> important message is: you should choose your data structure to facilitate
> the analysis that you have in mind. IMHO, this is one of R's great
> strengths: it provides rich facilities for manipulating data tightly
> integrated with plotting and analytical capabilities.
>
> Cheers,
> Bert
>
> On Wed, Nov 2, 2011 at 9:46 AM, Rich Shepard <rshep...@appl-ecosys.com>wrote:
>
>> On Wed, 2 Nov 2011, Rich Shepard wrote:
>>
>>   I want a subset of this with only 7 chemicals: Ca, Cl, Cond, Mg, Na,
>>> SO4,
>>> and TDS.
>>>
>>
>>  I should have also written that what I ultimately want is to create a
>> box-and-whisker plot for these 7 chemicals in a single panel. If that can
>> be
>> done directly from the source data frame without creating another subset,
>> I
>> want to learn the syntax for that.
>>
>> Rich
>>
>> ______________________________**________________
>> R-help@r-project.org mailing list
>> https://stat.ethz.ch/mailman/**listinfo/r-help<https://stat.ethz.ch/mailman/listinfo/r-help>
>> PLEASE do read the posting guide http://www.R-project.org/**
>> posting-guide.html <http://www.R-project.org/posting-guide.html>
>> and provide commented, minimal, self-contained, reproducible code.
>>
>
>
>
> --
>
> Bert Gunter
> Genentech Nonclinical Biostatistics
>
> Internal Contact Info:
> Phone: 467-7374
> Website:
>
> http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm
>
>
>


-- 

Bert Gunter
Genentech Nonclinical Biostatistics

Internal Contact Info:
Phone: 467-7374
Website:
http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm

        [[alternative HTML version deleted]]

______________________________________________
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