Hola Estoy utilizando el siguiente código para generar una xyplot usando celosíaCómo cambiar el orden de los paneles en los gráficos de celosía simples
xyplot(Rate~Weight|Temp, groups=Week, rate,
pch=c(15,16,17,3), col=c("blue","red","green","purple"),
as.table=TRUE,
xlab="Weight (gr)", ylab="Rate (umol/L*gr)",
main="All individuals and Treatments at all times",
strip=strip.custom(strip.names=1),
key=
list(text=list(c("Week","1","2","6","8")),
points=list(pch=c(NA,15,16,17,3),col=c(NA,"blue","red","green","purple")),
space="right")
)
Esto me da el siguiente diagrama:
Ahora, después de cambiar el código para incluir el fin del panel como se sugiere:
xyplot(Rate~Weight|Temp, groups=Week, rate,
index.cond=list(c(4,1,2,3)),#this provides the order of the panels
pch=c(15,16,17,3), col=c("blue","red","green","purple"),
as.table=TRUE,
xlab="Weight (gr)", ylab="Rate (umol/L*gr)",
main="All individuals and Treatments at all times",
strip=strip.custom(strip.names=1),
key=
list(text=list(c("Week","1","2","6","8")),
points=list(pch=c(NA,15,16,17,3),col=c(NA,"blue","red","green","purple")),
space="right")
)
y obtenemos el orden correcto
Gracias por la ayuda
+1 para proporcionar datos y solución probada. Sería mejor si los datos estuvieran en formato R-ready (usando 'dput' o construyendo un' data.frame'/'matrix' usando' sample', 'runif',' letters' ...). –
@Roman Incluí el código de trabajo y los gráficos para ilustrar espero que ayude :) – BDM