[R-sig-eco] Change the text in the strips of a Lattice plot

Johannes Signer j.m.signer at gmail.com
Fri Jun 24 14:31:07 CEST 2011


Does that help you?

library(lattice)
library(datasets)
data(CO2)

levels(CO2$Type) <- c("A", "B")
levels(CO2$Treatment) <- c("no enfriado", "enfriado")

xyplot(uptake ~ conc | Type * Treatment,
 groups = Plant, type = "b", lty = rep(1:3, 4), strip = strip.custom(
var.name = c("Type",
 "Treatment "), strip.names = c(T,T), style = 3), data = CO2)


Johannes

On Fri, Jun 24, 2011 at 8:18 AM, Manuel Spínola <mspinola10 at gmail.com> wrote:
> Dear list members,
>
> I am trying the following plot in Lattice:
>
> library(lattice)
> library(datasets)
> data(CO2)
>
> xyplot(uptake ~ conc | Type * Treatment,
>  groups = Plant, type = "b", lty = rep(1:3, 4), strip = strip.custom(
> var.name = c("Type",
>  "Treatment "), strip.names = c(T,T), style = 3), data = CO2)
>
> How can I change the names of the levels of the 2 conditioning variables in
> the strip?
>
> I want to use: "Enfriado" and "No enfriado" instead of "chilled" and
> "nonchilled" for Treatmente, and "A" and "B" instead of "Quebec" and
> "Mississippi" for Type.
>
>
> Thank you very much in advance.
>
> Manuel
>
>
> --
> *Manuel Spínola, Ph.D.*
> Instituto Internacional en Conservación y Manejo de Vida Silvestre
> Universidad Nacional
> Apartado 1350-3000
> Heredia
> COSTA RICA
> mspinola at una.ac.cr
> mspinola10 at gmail.com
> Teléfono: (506) 2277-3598
> Fax: (506) 2237-7036
> Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
> Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>
>
>        [[alternative HTML version deleted]]
>
>
> _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>
>



More information about the R-sig-ecology mailing list