Skip to content

Error in dis[sppInSample,sppInSample]:subscript out of bounds

3 messages · marion howard, MacQueen, Don, John Kane

#
Hello,
I am new to R and am encountering an error message that I cannot find a solution for.
I am attempting to calculate MPD (mean pairwise distance), without weighting for abundance, with a community species list and a phylogenetic tree in newick format with branch lengths.
I have read in both list and tree .txt files and calculated PD without any problem.
To calculate MPD I have entered:>MPD1=mpd(list,cophenetic(tree))
Error:Error in dis[sppInSample, sppInSample] : subscript out of bounds
Thank you for you helpCheersMarion.
#
Before (I hope!) someone else answers in an unkind tone (and someone
probably will), I have a few suggestions:

1) please use plain text email (an option somewhere in your email
software). Using HTML email usually makes the email harder to read on
r-help.

2) if at all possible, please try to construct an example that other
people can easily run for themselves and provide the data. It makes it
much easier to provide help. This may be hard for someone new to R, but it
is worth it. The usual suggestion is to use the dput() function to include
example data in your email (or the real data if there's not too much of
it, and you are able to share).

3) please identify which packages your functions come from, since they are
not (I believe) part of base R. Sometimes it is essential to also include
the output of sessionInfo()

4) and check the posting guide mentioned at the bottom of the email for
suggestions on how to ask a question so as to have the best chance of
getting good answers.

Expectation are pretty high on r-help.

-Don
#
As a follow-up to Don's reply have a look at https://github.com/hadley/devtools/wiki/Reproducibility and/or  ttp://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example for some useful suggestions on how to frame a question.

If you need to include sample data with your reply please read carefully about the dput function and supply your data in dput() format.  

John Kane
Kingston ON Canada
____________________________________________________________
FREE ONLINE PHOTOSHARING - Share your photos online with your friends and family!
Visit http://www.inbox.com/photosharing to find out more!