RStudio:“安装并重启”后,找不到R包的功能

发布于 2025-01-20 17:36:46 字数 1288 浏览 4 评论 0 原文

我已经在Rstudio开始了一个新项目,并连接到GitHub存储库。然后,我将rstudio项目变成了一个带有

一切似乎还可以。但是,在i library(mypackage)),找不到软件包中的功能(rstudio无法完成键入,并且明确调用会引起错误)。相反,我必须首先致电

rstudio中的“ install and restart” 命令产生以下内容:

==> Rcmd.exe INSTALL --no-multiarch --with-keep.source mypackage

* installing to library 'path-to-r'
* installing *source* package 'mypackage' ...
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
No man pages found in package  'mypackage' 
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (mypackage)

重新启动后,rstudio调用 library

是否可以是调用 create_package()对于现有项目,不是创建所有必要的设置(它们可能是什么?)?首先,当在RSTUDIO中创建R软件包(并从现有项目创建一个存储库)时,可以在构建后找到所有函数(如应该)。

I have started a new project in RStudio and by connecting to a GitHub repository. Then I turned the RStudio project into an R package with usethis::create_package().

Everything seems ok. However, after I "Install and Restart" the project and attach the package (library( mypackage )), the functions in the package can not be found (RStudio does not complete typing, and an explicit call raises an error). Instead, I have to first call devtools::load_all().

The "Install and Restart" command in RStudio produces the following:

==> Rcmd.exe INSTALL --no-multiarch --with-keep.source mypackage

* installing to library 'path-to-r'
* installing *source* package 'mypackage' ...
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
No man pages found in package  'mypackage' 
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (mypackage)

After the restart, RStudio calls library( mypackage )

Could it be that calling create_package() for an existing project, does not create all the necessary settings (what might they be?)? When start by creating an R package in RStudio (and create a repository from the existing project), all functions can be found after build (as they should).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文