我正在使用此代码绘制图表,但我不知道如何添加图例?
library(gplots)
data1 <- as.matrix(read.table('$INPUT_FILE1', header = T))
data2 <- as.matrix(read.table('$INPUT_FILE2', header = T))
data1.experiment <- as.factor(data1[,\"$FACTORS\"])
data1.obs <- as.numeric(data1[,\"$RESPONSE_VAR\"])
data2.obs <- as.numeric(data2[,\"$RESPONSE_VAR\"])
pdf(file = 'MeanPlot.pdf', width=5, height=5)
plotmeans(data2.obs ~ data1.experiment, xlab='$FACTORS', ylab='$RESPONSE_VAR')
plotmeans(data1.obs ~ data1.experiment, xlab='$FACTORS', ylab='$RESPONSE_VAR')