有没有办法在用户加载时显示消息library(myCustomLibrary)?加载后,我想显示一条消息,告诉用户如何运行所有测试功能.
我的包需要ggplot2包,但是我无法修复运行R CMD检查时得到的以下注释.
no visible global function definition for qplot
'library' or 'require' call not declared from: ggplot2
Run Code Online (Sandbox Code Playgroud)
我也有一个.onLoad函数,
.onLoad <- function(libname, pkgname){
.libPaths("~/RLibrary")
require(ggplot2)
}
Run Code Online (Sandbox Code Playgroud)
有关如何解决错误的任何建议?我应该在哪里放置onLoad功能?
谢谢
圣