0

Here's the problem: I have two data sets and would like to merge the interaction plots of both into one. The variables are the same, it is just a matter of different methods which are to be compared. With lines() I don't get any further and don't know anymore what to do. Can you help me?

I already tried creating the plot in R and then using lines() to add the lines from the other dataset. Unfortunately it does not work.

interaction.plot(x.factor = data_EAS$Zeitpunkt, 
             trace.factor = data_EAS$Wassertyp, 
             response = data_EAS$AZY_ERY, 
             fun = mean,
             ylab = "Konzentration [µg/g]",
             xlab = "Inkubationszeit [Wochen]",
             col = c("grey", "black"),
             lty = 1, 
             lwd = 2, 
             trace.label = "Wasserqualität")

lines(data_RES$Zeitpunkt, data_RES$AZY_ERY,  col = c("grey", "black"), 
             lty = 1, lwd = 2)

The code get through without any errors but the lines doesn't appear in the plot.

So I want to combine those two interaction plot.

interaction.plot(x.factor = data_RES$Zeitpunkt, #x-axis variable
             trace.factor = data_RES$Wassertyp, #variable for lines
             response = data_RES$AZY_ERY, #y-axis variable
             fun = mean, #metric to plot
             ylab = "Konzentration [µg/g]",
             xlab = "Inkubationszeit [Wochen]",
             col = c("grey", "black"),
             lty = 1, #line type
             lwd = 2, #line width
             trace.label = "Wasserqualität")



interaction.plot(x.factor = data_EAS$Zeitpunkt, 
             trace.factor = data_EAS$Wassertyp, 
             response = data_EAS$AZY_ERY, 
             fun = mean,
             ylab = "Konzentration [µg/g]",
             xlab = "Inkubationszeit [Wochen]",
             col = c("grey", "black"),
             lty = 1, 
             lwd = 2, 
             trace.label = "Wasserqualität")

0 Answers0