简体   繁体   English

为什么R找不到函数“ getStates”

[英]Why can R not find function “getStates”

I am trying to create a character map and was recommended to use Phylotools and Ape packages in R. 我正在尝试创建字符映射,建议在R中使用Phylotools和Ape软件包。

I have installed the packages but when I try to do function getStates it comes up with an error message: 我已经安装了软件包,但是当我尝试执行功能getStates它会出现错误消息:

x<-getStates(nexdata,"tips")
Error in getStates(nexdata, "tips") : could not find function "getStates"

I have installed the right packages (so I think) and I am quite stuck. 我已经安装了正确的软件包(所以我认为),我非常困惑。 Any help would be really appreciated. 任何帮助将非常感激。 If you need me to explain anything in more detail let me know. 如果您需要我详细解释任何事情,请告诉我。

The function library() loads and attaches add-on packages. 函数library()加载并附加附加软件包。 You are using phytools and ape , so you should have in your code 您正在使用phytoolsape ,因此您应该在代码中使用

library(phytools)
library(ape)

You can read more in the documentation, eg at rdocumentation.org/packages/base/versions/3.6.1/topics/library . 您可以在文档中阅读更多信息,例如rdocumentation.org/packages/base/versions/3.6.1/topics/library

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM