2

I am trying to run a null model for some community data and am receiving the same error repeatedly and have been unable to figure it out. I have tried changing the format, doing a smaller subset and various other things but to no avail.

The data format recommended is like this:

community Ck Cj Cl
w0-200    1  1  1
w200-400  0  1  1
w400-600  0  1  0
w600-800  0  1  0
w800-1000 0  1  0

but consists of 31 rows and 42 columns. The code I'm using is

ses.mpd(my.sample, cophenetic(my.phylo), null.model =
"taxa.;ables", abundance.weighted = F, runs = 999,
iterations = 1000)

or

#1. randomize community data matrix
ses.mpd.nullmodel.values<-ses.mpd(my.sample, cophenetic(my.phylo), null.model = "independentswap", abundance.weighted = F, runs = 999, iterations = 1000)
write.xlsx(ses.mpd.nullmodel.values, "~ewmaeint.xlsx", row.names=TRUE)

The error message I get is

Error in numeric(N) : invalid 'length' argument

What does it mean? The traceback didn't really help me:

traceback()
3: numeric(N)
2: mpd(samp, dis, abundance.weighted = abundance.weighted)
1: ses.mpd(my.sample, cophenetic(my.phylo), null.model = "taxa.;ables", 
abundance.weighted = F, runs = 999, iterations = 1000)
  • Can you please make your [example reproducible](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example)? Do not forget to specify which packages you're using. Are there any examples in the help file for `ses.mpd`? Does it run for you? Have you compared how the example differs from your data? – Roman Luštrik Sep 19 '16 at 11:28
  • the data came out wierd in the post, im not sure how to put it in a table here. the column headings are the species names, and the rows are elevation groups. The 0 and 1 represent presence and absence data. #1. randomize community data matrix ses.mpd.nullmodel.values<-ses.mpd(my.sample, cophenetic(my.phylo), null.model = "independentswap", abundance.weighted = F, runs = 999, iterations = 1000) write.xlsx(ses.mpd.nullmodel.values, "~ewmaeint.xlsx", row.names=TRUE) – Wyzen Bogaard Sep 21 '16 at 06:43
  • community Ck Cj Cl Ed Hc Maa Mb Mr w0-200 1 1 1 1 1 1 1 1 w200-400 0 1 1 0 1 1 0 0 w400-600 0 1 0 0 1 1 0 0 w600-800 0 1 0 1 0 0 0 0 w800-1000 0 1 0 0 0 1 0 0 w1000-1200 0 0 0 0 0 1 0 0 w1200-1400 0 0 0 0 0 0 0 0 w1400-1600 0 0 0 0 0 0 0 0 w1600-1800 0 0 0 0 0 0 0 0 w1800-2000 0 0 0 1 0 0 0 0 here is an example of the data it doesnt run it just gives me the error even when i use a small subset like this. – Wyzen Bogaard Sep 21 '16 at 06:50
  • Please edit the original question. You need to indent the text 4 spaces to make it "code like". There is a `{}` icon to help you with that. – Roman Luštrik Sep 21 '16 at 07:16
  • i cant post the nexus data in a comment as it is too long could i email it to you – Wyzen Bogaard Sep 21 '16 at 07:21
  • thanks Roman Luštrik – Wyzen Bogaard Sep 21 '16 at 07:26

0 Answers0