NAMESPACE 不是由 roxygen2 生成的.跳过.- 与哈德利书混淆 [英] NAMESPACE not generated by roxygen2. Skipped. - Confusion with Hadley book
问题描述
我正在尝试制作一个包,但是当我运行 document()
时,它会打印出 NAMESPACE 不是由 roxygen2 生成的.跳过.
我正在尝试在我的函数中使用 ggplot2,XML, R6
包.我通过以下方式导入它们:
I am trying to make a package but when I run document()
it prints NAMESPACE not generated by roxygen2. Skipped.
I am trying to use ggplot2,XML, R6
packages in my functions. I am importing them in the following way:
#' @rdname visualization
#' @param hist_data A table of weather variables with PWS created by hist_data function
#' @param variable A character string of variable name
#' @examples
#' table <- getWeather(city = "San Francisco", state="CA")
#' please <- getConditionsTable(table, "2015-03-09")
#' tab <- hist_data(table, please)
#' head(tab)
#' plot_variable_across_all_pws(hist_data=tab, variable="tempi")
#' @import ggplot2
#' @import XML
#' @import R6
我想知道是什么导致了这个错误,我的 Namespace
除了 exportPattern("^[^\.]")
I am wondering what might be causing this error and there is nothing in my Namespace
except for exportPattern("^[^\.]")
另外,我正在阅读 Hadley 的 R 包书籍 http://r-pkgs.had.co.nz/namespace.html并被这条线弄糊涂了:
Also, I was going over R packages book by Hadley http://r-pkgs.had.co.nz/namespace.html And confused by the line :
"请注意,您可以选择使用 roxygen2 只生成 NAMESPACE,只生成 man/*.Rd,或两者兼而有之.如果您不使用任何与命名空间相关的标签,则 roxygen2 不会触及 NAMESPACE.如果您不使用任何与文档相关的标签,roxygen2 不会触及 man/."
"Note that you can choose to use roxygen2 to generate just NAMESPACE, just man/*.Rd, or both. If you don’t use any namespace related tags, roxygen2 won’t touch NAMESPACE. If you don’t use any documentation related tags, roxygen2 won’t touch man/."
这是我做错了吗?还是失踪了?
Is this what I'm doing wrong? or missing?
推荐答案
- 备份 NAMESPACE 文件,如果您需要它以备将来使用
- 删除命名空间文件
- 运行
devtools::document()
,让roxygen2在包源目录下生成新的NAMESPACE文件
- Backup NAMESPACE file, if you need it for future use
- Delete the NAMESPACE file
- Run
devtools::document()
, so that roxygen2 will generate new NAMESPACE file in the package source directory
*** 确保您在 R 源文件的 roxygen2 doc 部分中有 @export
标签.
*** make sure you have @export
tag in the roxygen2 doc section of the R source file.
这篇关于NAMESPACE 不是由 roxygen2 生成的.跳过.- 与哈德利书混淆的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!