library(readr) library(dplyr) library(tidyverse) library(nortest) renvi <- read.csv("RiosEnvi.csv") renvi$Land.use <- as.factor(renvi$Land.use) renvi$Land.use1 <- as.factor(renvi$Land.use1) renvi$River <- as.factor(renvi$River) for (i in 5:ncol(renvi)) {renvi[[i]] <- as.numeric(renvi[[i]])} str(renvi) #PERMANOVA library(vegan) ###Pairwise permanova install.packages("remotes") remotes::install_github("phytomosaic/ecole") library(ecole) #DO adonis2(renvi$DO ~ renvi$Land.use, method = "bray", perm =999, padj = "bonferroni") set.seed(910) permanova_pairwise(x = renvi$DO, grp = renvi$Land.use, permutations = 999, padj = "bonferroni") #Temperature adonis2(renvi$Temperature ~ renvi$Land.use, method = "bray", perm =999, padj = "bonferroni") set.seed(910) permanova_pairwise(x = renvi$Temperature, grp = renvi$Land.use, permutations = 999, padj = "bonferroni") #conductiviy adonis2(renvi$Conductivity ~ renvi$Land.use, method = "bray", perm =999, padj = "bonferroni") #pH adonis2(renvi$pH ~ renvi$Land.use, method = "bray", perm =999, padj = "bonferroni") #turbidity adonis2(renvi$Turbidity ~ renvi$Land.use, method = "bray", perm =999, padj = "bonferroni") set.seed(910) permanova_pairwise(x = renvi$Turbidity, grp = renvi$Land.use, permutations = 999, padj = "bonferroni") #inorgN adonis2(renvi$Inorganic.N ~ renvi$Land.use, method = "bray", perm =999, padj = "bonferroni") #NH4 adonis2(renvi$NH4 ~ renvi$Land.use, method = "bray", perm =999, padj = "bonferroni") #NO3 NO3_data <- na.omit(renvi_a) NO3_data adonis2(NO3_data$NO3_1 ~ NO3_data$Land.use, method = "bray", perm =999, padj = "bonferroni") set.seed(910) permanova_pairwise(x = NO3_data$NO3_1, grp = NO3_data$Land.use, permutations = 999, padj = "bonferroni") #SiO2 adonis2(renvi$Silica ~ renvi$Land.use, method = "bray", perm =999, padj = "bonferroni") #Light adonis2(renvi$Light ~ renvi$Land.use, method = "bray", perm =999, padj = "bonferroni") set.seed(910) permanova_pairwise(x = renvi$Light, grp = renvi$Land.use, permutations = 999, padj = "bonferroni")