R包签入RStudio-未找到函数错误
我正在尝试使用RStudio/git在R中构建一个包 当我对此文件运行检查功能时:R包签入RStudio-未找到函数错误,r,R,我正在尝试使用RStudio/git在R中构建一个包 当我对此文件运行检查功能时: #' A function to print variable names for easy pasting to a new character vector. #' #' @param x a data.frame #' @examples require(convPkg5);cat_names(iris) #' cat_names <- function(x){ cat(paste(",'",
#' A function to print variable names for easy pasting to a new character vector.
#'
#' @param x a data.frame
#' @examples require(convPkg5);cat_names(iris)
#'
cat_names <- function(x){
cat(paste(",'", names(x), "'", "\n", sep = ""))
}
所有其他文件/函数都具有类似的结构,但不会生成错误消息。我遗漏了什么?我不知道你是否发现了这个问题,但我也遇到了同样的问题,并在哈德利的报告中找到了解决问题的方法 您应该能够通过添加
@export
来解决此问题。请按以下方式执行roxygen注释
#' A function to print variable names for easy pasting to a new character vector.
#'
#' @param x a data.frame
#' @examples require(convPkg5);cat_names(iris)
#'
#' @export
可能需要导出函数才能在示例中访问?正如@joran所暗示的,请查看您的
名称空间。可能此函数未导出,您需要:
才能访问它。
#' A function to print variable names for easy pasting to a new character vector.
#'
#' @param x a data.frame
#' @examples require(convPkg5);cat_names(iris)
#'
#' @export