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
有什麼我錯過了?