Rdpack (version 0.4-20)

deparse_usage: Convert f_usage objects to text appropriate for usage sections in Rd files

Description

Converts f_usage objects to text appropriate for usage sections in Rd files. Handles S3 methods.

Usage

deparse_usage(x) deparse_usage1(x, width = 72) "as.character"(x, ... )

Arguments

x
an object from class f_usage
width
maximal width of text on a line
...
ignored; this argument is present for consistency with the generic as.character

Value

For deparse_usage1 and as.character.f_usage, a named character vector of length one (the name is the function name).For deparse_usage, a named character vector with one entry for the usage text for each function.

Details

deparse_usage1 is internal function. For users as.character is more convenient.

See Also

pairlist2f_usage and pairlist2f_usage1

Examples

Run this code
cur_wd <- getwd()
setwd(tempdir())

# as for prompt() the default to save in current dir as "seq.Rd".
fnseq <- reprompt(seq)

# let's parse the saved Rd file
rdoseq <- parse_Rd(fnseq)

# the usage of 'seq' has several entries, parse them all

ut <- get_usage_text(rdoseq)
cat(ut,"\n")

utp <- parse_usage_text(ut)

# format some of them
as.character(utp[[1]])
deparse_usage1(utp[[1]])  # same

cat(deparse_usage1(utp[[2]]))
cat(as.character(utp[[2]]))   # same


unlink(fnseq)

Run the code above in your browser using DataLab