I'm using RStudio. I have a dataframe called data.
I've plotted these variables separately:
data_tmp<-xts(as.matrix(data[,-1]), order.by = data$date)
autoplot(data_tmp$sales)
autoplot(data_tmp$temperature)
I would like to combine the variables "sales" and "temperature" in a single graph, with a different colour for each variable, so I can check the seasonality and if they are correlated. The problem that I'm facing is the differences in the scale. I would like to create two 'y' axis so both variables are with the same scale.