以下是我在仅针对单个变量进行条件约束时使用的代码。使用下面的index.cond可以用于在最终图形中切换面板的顺序。但是,现在我正在针对两个变量进行条件约束,下面的代码不能用于切换不同面板的位置。如何修改index.cond使其有效?以下是我的代码和图形以及样本数据的图片:
我希望可以交换列的顺序。
以下是示例数据集:
libs <- c('lattice', 'latticeExtra', 'gridExtra', 'MASS', 'colorspace', 'plyr', 'Hmisc', 'scales')
lapply(libs, require, character.only = T)
conversion_test <- read.table("Desktop/FAST/convert_test/Results/fasconvert_Results", sep="\t", header=TRUE)
scatter.lattice <- xyplot(Time.to.Completion..s. ~ Number.of.Sequences | Length * Conversion, data = conversion_test, ylab = "Time to Completion (s)", xlab = "Number of Sequences", index.cond=list(c(2,1,4,3)), pch=16,
panel = function(x, y, ...) {
panel.xyplot(x, y, ...)
lm1 <- lm(y ~ x)
lm1sum <- summary(lm1)
r2 <- lm1sum$adj.r.squared
panel.abline(a = lm1$coefficients[1],
b = lm1$coefficients[2])
panel.text(labels =
bquote(italic(R)^2 ==
.(format(r2,
digits = 5))),
x = 500000, y = 10)
},
xscale.components = xscale.components.subticks,
yscale.components = yscale.components.subticks,
as.table = TRUE)
scatter.lattice
我希望可以交换列的顺序。
以下是示例数据集:
Numberofseq timetoCompletion Length Conversion
25000 9.3 100bp ClustalW
250000 45 100bp ClustalW
25000 9.3 100bp Fasta
250000 45 100bp Fasta
25000 9.3 1000bp ClustalW
250000 45 1000bp ClustalW
25000 9.3 1000bp Fasta
250000 45 1000bp Fasta