Learn R Programming

Rd (version 0.2.0)

toRd: Convert an object to Rd

Description

This provides the generic for converting objects to Rd. It extends the core function toRd.

Usage

toRd(obj, ...)

\S3method{toRd}{NULL}(obj, ...)

\S3method{toRd}{list}(obj, ..., unnest=NA)

\S3method{toRd}{Rd_string}(obj, ...)

\S3method{toRd}{Rd_tag}(obj, ...)

\S3method{toRd}{Rd}(obj, ...)

\S3method{toRd}{person}(obj, ..., include = c('given', 'family', 'email'))

\S3method{toRd}{name}(obj, ...)

Arguments

obj

object to convert

...

passed on to methods

unnest

Should the results be unlisted to remove nesting? A value of FALSE indicates that nesting should never be removed, TRUE implies always remove nested elements with class Rd, and when NA, the default, nesting will be removed only if all elements are Rd.

include

The parts of the person object to include.

Examples

Run this code
# NOT RUN {
str(toRd(NULL))
toRd(person('John' , 'Doe', email="john@email.com"))
toRd(c( person('John' , 'Doe', email="john@email.com")
      , person('Jane' , 'Poe', email="jane@email.com")
      ))
# }

Run the code above in your browser using DataLab