我已经在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).
发布评论