I am not familiar with the vegan package, so I am just making a guess here. If 'na.action=na.omit' is part of the call to varpart, try removing it from the function call and moving it above as follows:
options(na.action="na.omit") RDA_Ger <- varpart(comm, x1, x2, x3, transfo="hellinger", scale = FALSE) Maybe that will help. Regards, Eric On Sat, Sep 16, 2017 at 6:53 PM, Sophi Marmen <sofimar...@gmail.com> wrote: > I'm trying to perform a RDA analysis in the vegan package using the > "varpart" function. > > I have a matrix of community structure data in different sites (rows), > which I want to explain using 3 matrices of environmental data. The 3 > matrices are: > > water quality parameters; > > local land use variables; > > total land use variables. > > In each matrix, the number of the rows is the same (the sites) and there > are different column number (measured varibakes). > > I use the follow script: > > WQ_RDA <- read.csv("F:/Sher_sophi_new3/RDA/WQ_RDA_1.csv", row.names = 1) > LU2_loc_RDA <- read.csv("F:/Sher_sophi_new3/RDA/LU2_loc_RDA_1.csv", > row.names = 1) > LU2_bas_RDA <- read.csv("F:/Sher_sophi_new3/RDA/LU2_basin_RDA_1.csv", > row.names = 1) > comm <- read.csv("F:/Sher_sophi_new3/RDA/Final_true_OTUs_97_1.csv", > row.names = 1) > > x1 = as.matrix(WQ_RDA) > x2 = as.matrix(LU2_loc_RDA) > x3 = as.matrix(LU2_bas_RDA) > comm = as.matrix(t(comm)) > > RDA_Ger = varpart(comm, x1, x2, x3, transfo="hellinger", scale = FALSE, > na.action = na.omit > > > I get this error message: > > Error in as.vector(x, mode) : > cannot coerce type 'closure' to vector of type 'any' > > Can anyone help me figure out what am I doing wrong? > > Thanks, > Sophi > -- > Sophi Marmen > Ph.D candidate > Marine Biology Department > Leon H. Charney School of Marine Sciences > University of Haifa, Israel > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/ > posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.