I have this code in R:
xyplot(remove_SMO ~ A, groups = C,
type="a",
ylab="Remoção de óleo (%)",
xlab = "pH",
auto.key = list(space = "right", points = FALSE, lines = TRUE))
And this similar one:
xyplot(remove_SMO ~ B, groups = E,
type="a",
ylab="Remoção de óleo (%)",
xlab = "Temperatura",
auto.key = list(space = "right", points = FALSE, lines = TRUE))
How could I do something like this using lattice
, grouping these two interaction graphs?
*The order of the graphics does not matter.
And what good material to learn how to edit graphs developed in lattice
? Note that the split
command for multiples plots helps but is not ideal, and there is difference in the positioning of the legend for the pink and blue lines. The "facet_wrap" with |
is also different, as it greatly changes the aesthetics.
My code for the example.
if(!require("FrF2")) install.packages("FrF2") ; library(FrF2)
if(!require("lattice")) install.packages("lattice") ; library(lattice)
plan.person = FrF2(nfactors = 5,
resolution = 5,
replications = 2,
randomize = FALSE,
factor.names = list(
A = c(3, 9),
B = c(5, 30),
C = c(0.05, 0.5),
D = c(50, 350),
E = c(100, 200)
))
remove_SMO <- c(94.80, 23.40, 99.60, 38.00, 80.20, 27.00, 96.40, 60.00, 99.90, 9.10,
98.40, 37.10, 99.77, 51.70, 97.40, 58.00, 95.10, 25.00, 99.50, 39.10,
80.60, 28.00, 96.70, 61.20, 99.70, 10.00, 98.80, 37.40, 99.40, 52.00,
97.70, 58.40)
plan.atualizado1 = add.response(design = plan.person, response = remove_SMO)
attach(plan.atualizado1)