首页 > 解决方案 > roxygen 方法的包文档

问题描述

我创建了一个名为多边形线性回归的回归模型。对应的函数是plr并返回类的一个对象plr。为了显示模型的摘要,我创建了一个函数摘要 ( summary.plr)。这个函数返回一个类的对象summary.plr。此外,我创建了第三个函数来打印summary.plr名为print.summary.plr. 我如何记录print.summary.plr使用方法roxygen2并为包中的其他功能导出该方法?

我试过这样:

#' Print Summary Polygonal Linear Regression
#'
#' @description print arguments of the class "\emph{summary.plr}" and returns it \emph{invisibly} (via \code{\link[base]{invisible}} (x)).
#' @method print summary.plr
#' @param x an object of the class "\emph{summary.plr}".
#' @param digits  non-null value for \code{digits} specifies the minimum number of significant 
#' digits to be printed in values.
#' @param concise a \emph{logical} used to determine the type of digits.
#' @export

#Outuput

Description

print arguments of the class "summary.plr" and returns it invisibly (via invisible (x)).

Usage

## S3 method for class 'summary.plr'
print(x, digits = max(3L, getOption("digits") -
  3L), concise = FALSE, ...)
Arguments

x an object of the class "summary.plr".
digits non-null value for digits specifies the minimum number of significant digits to be printed in values.
concise a logical used to determine the type of digits.

但我不知道这是否是正确的方法。

标签: rmethodsroxygen2

解决方案


推荐阅读