roxygen docs中的任意部分

Spa*_*man 93 r roxygen

Roxygen似乎工作的方式是第一行是\title,其他一切都在\details,然后任何@foo指令处理这些事情.但R文档比这更丰富.我可以拥有"\section{Llamas}{Are they ungulates?}".Rd文件.

但我无法让Roxygen做任何其他事情而不是将其全部包装在\ details中.我错过了什么吗?

我有一个hacky解决方案,这是}在我之前坚持一个无与伦比的\section.然后结束该\details部分.然后我不得不结束},因为roxygen认为它关闭了\details.Eeeeeurrrrrrrrgh.

Das*_*son 21

已添加此支持(至少在roxygen2中).你只需要添加@section Llamas:然后再做任何事情,直到满足新的指令将在Llamas部分.这是一个例子

#' Llama llama llama
#' 
#' More about llamas
#' 
#' @section Llamas:
#' Are they ungulates?
#' 
#' @section Not llamas:
#' This section is not about llamas.  It is not very interesting.
#' 
#' @param notused A parameter that isn't used at all!
#' @export
llama <- function(notused){
    return("LLAMA LLAMA LLAMA")
}
Run Code Online (Sandbox Code Playgroud)

它为.Rd文件提供以下内容

\name{llama}
\alias{llama}
\title{Llama llama llama}
\usage{
  llama(notused)
}
\arguments{
  \item{notused}{A parameter that isn't used at all!}
}
\description{
  More about llamas
}
\section{Llamas}{
  Are they ungulates?
}

\section{Not llamas}{
  This section is not about llamas.  It is not very
  interesting.
}
Run Code Online (Sandbox Code Playgroud)