由于某种原因,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)发布于 2021-07-24 00:19:24
这个错误来自downlit::evaluate_and_highlight (遗憾的是它没有在输出中报告),可以通过安装downlit的开发版本来修复
library(devtools)
install_github('r-lib/downlit')只有当你使用pkgdown的git版本时才有意义,稳定的pkgdown (版本1.6.1)和稳定的downlit运行得很好。当然,任何包的开发版本都可能在任何时候崩溃,但在它不崩溃之前,一切都是正常的。
https://stackoverflow.com/questions/66806694
复制相似问题