The xyplot help page covers several lattice plots and states that with the exception of xyplot the formula can have the form x ~ y | c. I need to generate x-y plots for only one of two levels of a conditioning factor. What is the recommended way to do this? Rich
xyplot(): How to Apply Conditional?
5 messages · Rich Shepard, David Winsemius
On Oct 17, 2012, at 10:44 AM, Rich Shepard wrote:
The xyplot help page covers several lattice plots and states that with the exception of xyplot the formula can have the form x ~ y | c. I need to generate x-y plots for only one of two levels of a conditioning factor. What is the recommended way to do this?
What exactly is being requested? Do you just need to learn how to use the subset parameter? I would not think that the conditioning syntax would be used when there were only one level desired.
David Winsemius, MD Alameda, CA, USA
On Wed, 17 Oct 2012, David Winsemius wrote:
What exactly is being requested? Do you just need to learn how to use the subset parameter? I would not think that the conditioning syntax would be used when there were only one level desired.
David,
When I try
xyplot(quant ~ sampdate | era, data = sb.d, main = 'Antimony Concentrations
by Time', ylab = 'Concentration (mg/L)', xlab = 'Time',
subset=era('Pre-Mining'))
this error is returned:
Error in eval(expr, envir, enclos) : could not find function "era"
But, 'era' is a factor in the data frame.
The syntax above works with bwplot() and I would like to understand why
it's not working with xyplot().
Thanks,
Rich
On Oct 17, 2012, at 1:29 PM, Rich Shepard wrote:
On Wed, 17 Oct 2012, David Winsemius wrote:
What exactly is being requested? Do you just need to learn how to use the subset parameter? I would not think that the conditioning syntax would be used when there were only one level desired.
David,
When I try
xyplot(quant ~ sampdate | era, data = sb.d, main = 'Antimony
Concentrations
by Time', ylab = 'Concentration (mg/L)', xlab = 'Time',
subset=era('Pre-Mining'))
this error is returned:
Error in eval(expr, envir, enclos) : could not find function "era"
But, 'era' is a factor in the data frame.
The syntax above works with bwplot() and I would like to understand
why
it's not working with xyplot().
What do you expect when you give xyplot only one panel's worth of data and specify a multipanel formula?
David Winsemius, MD Alameda, CA, USA
On Oct 17, 2012, at 1:29 PM, Rich Shepard wrote:
On Wed, 17 Oct 2012, David Winsemius wrote:
What exactly is being requested? Do you just need to learn how to use the subset parameter? I would not think that the conditioning syntax would be used when there were only one level desired.
David,
When I try
xyplot(quant ~ sampdate | era, data = sb.d, main = 'Antimony
Concentrations
by Time', ylab = 'Concentration (mg/L)', xlab = 'Time',
subset=era('Pre-Mining'))
this error is returned:
Error in eval(expr, envir, enclos) : could not find function "era"
But, 'era' is a factor in the data frame.
The syntax above works with bwplot() and I would like to understand
why
it's not working with xyplot().
Furthermore, can you show "working" code that uses a column name as a function? That is the error being reported. Perhaps if you changed to: subset=era=='Pre-Mining'
David Winsemius, MD Alameda, CA, USA