[R] Help with RDA analysis, function ''varpart'' in vegan

Sophi Marmen sofimarman at gmail.com
Sat Sep 16 17:53:49 CEST 2017

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?

Sophi Marmen
Ph.D candidate
Marine Biology Department
Leon H. Charney School of Marine Sciences
University of Haifa, Israel

	[[alternative HTML version deleted]]

More information about the R-help mailing list