0
我想创建一个包。我使用ggplot2
库作为其中一个功能。导入不导入r包开发
我已经写了import语句功能:在DESCRIPTION
#' @param x the dataframe
#' @param Column the dataframe
#' @param Code the dataframe
#' @keywords Appointment filtering
#' @import ggplot2
#' @importFrom magrittr '%>%'
#' @importFrom dplyr arrange group_by summarise
#' @import rlang
#' @export
和书面Imports:ggplot2
如下
Package: MyPackage
Title: What the Package Does (one line, title case)
Version: 0.0.0.9000
[email protected]: person("Sebastian", "Zeki", email = "[email protected]", role = c("aut", "cre"))
Description: What the package does (one paragraph).
Depends: R (>= 3.4.0)
Imports:
ggplot2
License: What license is it under?
Encoding: UTF-8
LazyData: true
RoxygenNote: 6.0.1
每当我跑从devtools
load_all()
或
document()
我得到的错误:
Error in ggplot(....) :
could not find function "ggplot"
我已经注意到,NAMESPACE
文件不包含ggplot但是拥有其他进口存在,但是当我添加到手动NAMESPACE
我得到一个错误说:
Error in importIntoEnv(pkgenv, exports, nsenv, exports) :
cannot add bindings to a locked environment
有什么我错过了?