create_roxygen: Create the roxygen documentation

Description Usage Arguments Value Author(s) Examples

View source: R/rd2roxygen.R

Description

The parsed information is converted to a vector of roxygen tags.

Usage

1
create_roxygen(info, usage = FALSE)

Arguments

info

the named list of the parsed documentation

usage

logical: whether to include the usage section in the output (this can be useful when there are multiple functions in a single usage section, but generally it is not necessary because roxygen can generate the usage section automatically)

Value

a character vector

Author(s)

Hadley Wickham; modified by Yihui Xie <http://yihui.org>

Examples

1
2
3
rd.file = system.file("examples", "parse_and_save.Rd", package = "Rd2roxygen")
options(roxygen.comment = "##' ")
create_roxygen(parse_file(rd.file))

Example output

 [1] "##' Parse the input Rd file and save the roxygen documentation into a file."  
 [2] "##' "                                                                         
 [3] "##' Parse the input Rd file and save the roxygen documentation into a file."  
 [4] "##' "                                                                         
 [5] "##' "                                                                         
 [6] "##' @param path the path of the Rd file"                                      
 [7] "##' @param file the path to save the roxygen documentation"                   
 [8] "##' @param usage logical: whether to include the usage section in the output" 
 [9] "##' @return a character vector if \\code{file} is not specified, or write the"
[10] "##' vector into a file"                                                       
[11] "##' @author Hadley Wickham; modified by Yihui Xie <\\url{http://yihui.name}>" 

Rd2roxygen documentation built on July 2, 2020, 2:51 a.m.