Zhao Shanshan
2021-Oct-31 15:57 UTC
[R] Error in dis[sppInSample,sppInSample]:subscript out of bounds
Hi, I have the same problem, can you tell me how to solve it? 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. [[alternative HTML version deleted]] [[alternative HTML version deleted]]
Bert Gunter
2021-Nov-01 20:02 UTC
[R] Error in dis[sppInSample,sppInSample]:subscript out of bounds
This question is about an (unspecified! -- tell us which one so we don't have to guess) contributed package. The Posting Guide linked below says: "For questions about functions in standard packages distributed with R (see the FAQ Add-on packages in R <https://cran.r-project.org/doc/FAQ/R-FAQ.html#Add-on-packages-in-R>), ask questions on R-help. If the question relates to a *contributed package* , e.g., one downloaded from CRAN, try contacting the package maintainer first. You can also use find("functionname") and packageDescription("packagename") to find this information. *Only* send such questions to R-help or R-devel if you get no reply or need further assistance. This applies to both requests for help and to bug reports." Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Mon, Nov 1, 2021 at 12:49 PM Zhao Shanshan <sszhao19 at outlook.com> wrote:> Hi, I have the same problem, can you tell me how to solve it? > > > > > > 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. > > [[alternative HTML version deleted]] > > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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]]