我有一个我在RStudio中构建的R包,让我们称它为my_pkg
.当我devtools::load_all(".")
在RStudio中运行时(特别是使用Ctrl + Shift + L
快捷方式),我收到以下消息:
Loading my_pkg Warning messages: 1: character(0) 2: character(0) 3: character(0) 4: character(0) 5: character(0)
包中的所有功能都可以正常工作.我NAMESPACE
和DESCRIPTION
文件已完成,没有语法错误.?my_pkg
但是,当我运行时,帮助文件与文件中提供的规范不匹配DESCRIPTION
.当我删除Imports
from时DESCRIPTION
,没有更多的character(0)
警告信息.当然,我需要那些进口.当我改为Imports
时Suggests
,会有character(0)
警告信息.
这是描述文件内容,更改了一些内容以保护IP.
Package: scoutdroid Title: This is where the title is. Version: 0.1 Authors@R: "Ben Hanowell[aut, cre]" Description: This is where the description is. Depends: R (>= 3.1.0) Imports: dplyr, lubridate, mboost, randomForestSRC, RODBC, stringr License: file LICENSE LazyData: true
这是NAMESPACE
.
# Generated by roxygen2 (4.0.1): do not edit by hand import(RODBC) import(dplyr) import(lubridate) import(mboost) import(parallel) import(randomForestSRC) import(stringr)
当我在Build选项卡中使用RStudio Build&Reload按钮时,我收到以下警告:
**准备延迟装载包
Warning: replacing previous import by 'lubridate::intersect' when loading 'scoutdroid' Warning: replacing previous import by 'lubridate::setdiff' when loading 'scoutdroid' Warning: replacing previous import by 'lubridate::union' when loading 'scoutdroid'
编辑添加了一些更多细节,以帮助人们了解可能发生的事情.
编辑2我也添加了DESCRIPTION
文件,虽然我没有提供完整的包,这是专有的.
编辑3已添加NAMESPACE
.
编辑4添加了在"构建"选项卡中使用"RStudio构建和重新加载"按钮时出现的警告.