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

MacQueen, Don macqueen1 at llnl.gov
Thu Apr 2 01:43:28 CEST 2015

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

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 MacQueen

Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550

On 4/1/15, 2:04 PM, "marion howard" <marion.howard at hotmail.com> wrote:

>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. 		 	   		
>	[[alternative HTML version deleted]]
>R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
>PLEASE do read the posting guide
>and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list