Este es mi script. Basicamente es para calcular la diversidad beta de una comunidad como recambio de especie, riqueza o limitantes como factores esterantes. es necesario instalar una librería para poder tener los mismos efectos personalizados?. Abajo le dejo mi scrip y mi pregunta library (adespatial) library (ade4) library (betapart) if (require(ade4, quietly = TRUE)) data(habitat) habitat.pod.J <- beta.div.comp(habitat, coef = "J", quant = FALSE)
Sorensen
habitat.pod.S <- beta.div.comp(habitat, coef = "S", quant = FALSE)
Ruzicka
habitat.pod.qJ <- beta.div.comp(habitat, coef = "J", quant = TRUE)
Percentage difference
habitat.pod.qS <- beta.div.comp(habitat, coef = "S", quant = TRUE)
Data frames for the triangular plots
Data frames for the triangular plots
habitat.pod.J.3 <- cbind((1-habitat.pod.J$D), habitat.pod.J$repl, habitat.pod.J$rich) colnames(habitat.pod.J.3) <- c("Similarity", "Repl", "RichDiff") habitat.pod.S.3 <- cbind((1-habitat.pod.S$D), habitat.pod.S$repl, habitat.pod.S$rich) colnames(habitat.pod.S.3) <- c("Similarity", "Repl", "RichDiff") habitat.pod.qJ.3 <- cbind((1-habitat.pod.qJ$D), habitat.pod.qJ$repl, habitat.pod.qJ$rich) colnames(habitat.pod.qJ.3) <- c("Similarity", "Repl", "AbDiff") habitat.pod.qS.3 <- cbind((1-habitat.pod.qS$D), habitat.pod.qS$repl, habitat.pod.qS$rich) colnames(habitat.pod.qS.3) <- c("Similarity", "Repl", "AbDiff") par(mfrow = c(2, 2)) triangle.plot(as.data.frame(habitat.pod.J.3[, c(3, 1, 2)]), show = FALSE, labeltriangle = FALSE, addmean = TRUE ) text(-0.45, 0.5, "RichDiff", cex = 1.5) text(0.4, 0.5, "Repl", cex = 1.5) text(0, -0.6, "Jaccard similarity", cex = 1.5) triangle.plot(as.data.frame(habitat.pod.S.3[, c(3 ,1 ,2)]), show = FALSE, labeltriangle = FALSE, addmean = TRUE ) text(-0.45, 0.5, "RichDiff", cex = 1.5) text(0.4, 0.5, "Repl", cex = 1.5) text(0, -0.6, "Sorensen similarity", cex = 1.5) triangle.plot(as.data.frame(habitat.pod.qJ.3[, c(3, 1, 2)]), show = FALSE, labeltriangle = FALSE, addmean = TRUE ) text(-0.45, 0.5, "AbDiff", cex = 1.5) text(0.4, 0.5, "Repl", cex = 1.5) text(0, -0.6, "S = 1 – Ružička D", cex = 1.5) triangle.plot(as.data.frame(habitat.pod.qS.3[, c(3, 1, 2)]), show = FALSE, labeltriangle = FALSE, addmean = TRUE ) text(-0.45, 0.5, "AbDiff", cex = 1.5) text(0.4, 0.5, "Repl", cex = 1.5) text(0, -0.6, "S = 1 – Percentage difference", cex = 1.5)
Display values of the mean points in the triangular plots
colMeans(habitat.pod.J.3[, c(3, 1, 2)]) colMeans(habitat.pod.S.3[, c(3, 1, 2)]) colMeans(habitat.pod.qJ.3[, c(3, 1, 2)])
library (adespatial)
library (ade4)
library (betapart)
if (require(ade4, quietly = TRUE))
data(habitat)
habitat.pod.J <- beta.div.comp(habitat, coef = "J", quant = FALSE)
# Sorensen
habitat.pod.S <- beta.div.comp(habitat, coef = "S", quant = FALSE)
# Ruzicka
habitat.pod.qJ <- beta.div.comp(habitat, coef = "J", quant = TRUE)
# Percentage difference
habitat.pod.qS <- beta.div.comp(habitat, coef = "S", quant = TRUE)
# Data frames for the triangular plots
# Data frames for the triangular plots
habitat.pod.J.3 <- cbind((1-habitat.pod.J$D),
habitat.pod.J$repl,
habitat.pod.J$rich)
colnames(habitat.pod.J.3) <- c("Similarity", "Repl", "RichDiff")
habitat.pod.S.3 <- cbind((1-habitat.pod.S$D),
habitat.pod.S$repl,
habitat.pod.S$rich)
colnames(habitat.pod.S.3) <- c("Similarity", "Repl", "RichDiff")
habitat.pod.qJ.3 <- cbind((1-habitat.pod.qJ$D),
habitat.pod.qJ$repl,
habitat.pod.qJ$rich)
colnames(habitat.pod.qJ.3) <- c("Similarity", "Repl", "AbDiff")
habitat.pod.qS.3 <- cbind((1-habitat.pod.qS$D),
habitat.pod.qS$repl,
habitat.pod.qS$rich)
colnames(habitat.pod.qS.3) <- c("Similarity", "Repl", "AbDiff")
par(mfrow = c(2, 2))
triangle.plot(as.data.frame(habitat.pod.J.3[, c(3, 1, 2)]),
show = FALSE,
labeltriangle = FALSE,
addmean = TRUE
)
text(-0.45, 0.5, "RichDiff", cex = 1.5)
text(0.4, 0.5, "Repl", cex = 1.5)
text(0, -0.6, "Jaccard similarity", cex = 1.5)
triangle.plot(as.data.frame(habitat.pod.S.3[, c(3 ,1 ,2)]),
show = FALSE,
labeltriangle = FALSE,
addmean = TRUE
)
text(-0.45, 0.5, "RichDiff", cex = 1.5)
text(0.4, 0.5, "Repl", cex = 1.5)
text(0, -0.6, "Sorensen similarity", cex = 1.5)
triangle.plot(as.data.frame(habitat.pod.qJ.3[, c(3, 1, 2)]),
show = FALSE,
labeltriangle = FALSE,
addmean = TRUE
)
text(-0.45, 0.5, "AbDiff", cex = 1.5)
text(0.4, 0.5, "Repl", cex = 1.5)
text(0, -0.6, "S = 1 – Ružička D", cex = 1.5)
triangle.plot(as.data.frame(habitat.pod.qS.3[, c(3, 1, 2)]),
show = FALSE,
labeltriangle = FALSE,
addmean = TRUE
)
text(-0.45, 0.5, "AbDiff", cex = 1.5)
text(0.4, 0.5, "Repl", cex = 1.5)
text(0, -0.6, "S = 1 – Percentage difference", cex = 1.5)
# Display values of the mean points in the triangular plots
colMeans(habitat.pod.J.3[, c(3, 1, 2)])
colMeans(habitat.pod.S.3[, c(3, 1, 2)])
colMeans(habitat.pod.qJ.3[, c(3, 1, 2)])