【发布时间】:2021-06-22 16:15:47
【问题描述】:
由于某种原因,pkgdown 无法解析我的包中的 .Rd 文件之一。当我使用@examples 标记或@example inst/example/add.R 替代方法将示例添加到roxygen2 文档时,我发现它失败了。我将我的函数最小化为两个参数,以使其更“可重复”并且仍然得到相同的错误。请在下面找到错误消息、使用该devtools::document() 生成的 .Rd 文件以及该函数的 roxygen2 文档。如您所见,我正在使用一个非常简单的示例,应该可以毫无问题地运行...还要说的是,当我运行devtools::check() 时,我的所有示例都通过了,所以我不明白为什么pkgdown 失败了.
非常感谢您的帮助。
最好的,
错误信息
Reading 'man/merge.Rd'
Error : Failed to parse Rd in merge.Rd
i unused argument (output_handler = evaluate::new_output_handler(value = pkgdown_print))
Error: callr subprocess failed: Failed to parse Rd in merge.Rd
i unused argument (output_handler = evaluate::new_output_handler(value = pkgdown_print))
.Rd 文件
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/merge.R
\name{merge}
\alias{merge}
\title{Merge two tables}
\usage{
merge(x, y)
}
\arguments{
\item{x}{data frame: referred to \emph{left} in R terminology, or \emph{master} in
Stata terminology.}
\item{y}{data frame: referred to \emph{right} in R terminology, or \emph{using} in
Stata terminology.}
}
\value{
a data.table joining x and y.
}
\description{
This is the main and, basically, the only function in joyn.
}
\examples{
x <- c(1, 2)
}
roxygen2 文档
#' Merge two tables
#'
#' This is the main and, basically, the only function in joyn.
#'
#' @param x data frame: referred to *left* in R terminology, or *master* in
#' Stata terminology.
#' @param y data frame: referred to *right* in R terminology, or *using* in
#' Stata terminology.
#' @return a data.table joining x and y.
#' @export
#' @import data.table
#'
#' @examples
#' x <- c(1, 2)
【问题讨论】:
-
看起来您使用的是来自 Github 的
pkgdown的开发版本,而不是其依赖项的相应版本。除非您真的需要开发版本,否则请使用 CRAN 版本。 -
太棒了,非常感谢。我使用了 CRAN 版本,它工作正常。但是,尽管我有一个工作页面,但它仍然会给出一些奇怪的消息,说有些地方不对劲。在任何情况下。非常感谢!
标签: r devtools roxygen2 pkgdown