我正在使用 devtools 和 roxygen2 编写一个 R 包来做文档。该文档适用于除我的两个 R 文件之外的所有文件。对于这两个,第一个函数的文档文件 (.Rd) 是在没有 \title{} 行的情况下生成的。例如,这是我的普通 rd 文件顶部的样子:
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/general.R
\name{rmsd}
\alias{rmsd}
\title{Calculates the Root Mean Squared Deviation/Error}
\usage{...`
Run Code Online (Sandbox Code Playgroud)
这是由代码块生成的:
#' Calculates the Root Mean Squared Deviation/Error
#'
#' This function calculates the root mean squared error/deviation (RMSD/E)
#' between two vectors of numbers.
#'
#' @param x numeric, the first vector
#' @param y numeric, the second vector
#' …Run Code Online (Sandbox Code Playgroud)