Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jquery-ui/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R包签入RStudio-未找到函数错误_R - Fatal编程技术网

R包签入RStudio-未找到函数错误

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(",'",

我正在尝试使用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(",'", 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