Hi, I'm very new to R.
I need help.
I want the first graph to look the same as the second graph.
These are my codes.
Code #1
library(latticeExtra)
obj1 <- xyplot(BLAmountFinished ~ Lotname, dataset, type = "l", lwd=2)
obj2 <- xyplot(BLScrap ~ Lotname, dataset, type = "l", lwd=2)
doubleYScale(obj1, obj2, text = c("obj1", "obj2") , add.ylab2 = TRUE)
Code #2
#library
library(latticeExtra)
# create data
set.seed(1)
x <- 1:100
var1 <- cumsum(rnorm(100))
var2 <- var1^2
data <- data.frame(x,var1,var2)
# --> construct separate plots for each series
obj1 <- xyplot(var1 ~ x, data, type = "l" , lwd=2)
obj2 <- xyplot(var2 ~ x, data, type = "l", lwd=2)
# --> Make the plot with second y axis AND legend:
doubleYScale(obj1, obj2, text = c("obj1", "obj2") , add.ylab2 = TRUE)
What am I doing?