I have a lattice graph with two conditions: one condition (x1) has 4 levels and one has 2 levels (x2). The graph has a stripes for each variable x1 and x2:
df <- data.frame(y = runif(100,0,10)
, x1 = rep(c("A","B","C","D"),25)
, x2 = as.numeric(c(runif(100)<0.5))
)
histogram( ~y | x1 + as.factor(x2), data=df)
I would like to change the levels of x1.
I tried with:
histogram( ~y | x1 + as.factor(x2)
, data=df
, strip = strip.custom(
, factor.levels = c("no","yes"))
)
)
but I don’t konw how to assign the levels condition x2. I appreciate any hint.
Searching the web found solution defining own strip function.
EDIT – define own strips using useOuterStrips()