When documenting in Roxygen: How do I make an itemized list in @details?

删除回忆录丶 提交于 2020-02-26 10:49:09

问题


What is the appropriate syntax to add an itemized list to roxygen2, for instance, in the @details section? Can I create a latex list environment?

It seems that line breaks are simply ignored, i.e.

#' @details text describing parameter inputs in more detail
#'
#' parameter 1: stuff
#' 
#' parameter 2: stuff

thanks!


回答1:


Here is a roxygen2 example following your problem formulation.

##'
##' @details text describing parameter inputs in more detail.
##' \itemize{
##'  \item{"parameter 1"}{Stuff}
##'  \item{"parameter 2"}{Stuff}
##' }
##'

This will allow you to use itemize in details section. You can also use it in the @param sections.

Hope this helps.




回答2:


Since roxygen2 6.0.0 you can use markdown directly in your R documentation.

#' @details text describing parameter inputs in more detail.
#' * parameter 1 stuff
#' * parameter 2 stuff
#' @md

To use this either include Roxygen: list(markdown = TRUE) in your description to turn markdown on for the whole package or add the @md tag to a single file.



来源:https://stackoverflow.com/questions/9267584/when-documenting-in-roxygen-how-do-i-make-an-itemized-list-in-details

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!