o_help: Accessing Octave Help and Documentation Pages

Description Usage Arguments Value Octave Documentation for help Octave Documentation for doc Examples

View source: R/base-functions.R

Description

o_help retrieves the Octave help page associated with a given symbol. By default the page is printed out, but may also be silently retrieved or formatted for direct inclusion in R documentation files (i.e. Rd files).

o_doc displays documentation for the function FUNCTION_NAME directly from an on-line version of the printed manual, using the GNU Info browser. Type 'q' to quit the browser.

Usage

1
2
3
4
o_help(NAME, character.only = FALSE, show = interactive(),
  format = c("plain", "rd", "txt", "latex", "HTML"))

o_doc(FUNCTION_NAME)

Arguments

NAME

Octave symbol (e.g. command, function, operator) passed to Octave function help to retrieve the related documentation.

character.only

a logical indicating whether NAME can be assumed to be a character string (TRUE) or should be substituted with substitute before using them (default).

show

logical that specifies if the help page should be shown using the as R documentation file (default), e.g. using a pager, or only returned as a single string. Note that when show=TRUE, the string is still returned but invisibly.

format

a specification of the output format. If TRUE or 'rd', the result is Rd code that wraps the Octave documentation string and is suitable for inclusion into Rd files. If one of the strings 'txt', 'latex' or 'HTML', then the result is formated using the corresponding Rd conversion function from the tools package Rd2txt, Rd2latex or Rd2HTML.

FUNCTION_NAME

the name of the function from which to show the documentation. See the relevant Octave Documentation section below.

Value

this function is usually called for its side effect of printing the help page on standard output (argument show=TRUE), but it invisibly returns the help page as a single character string.

Octave Documentation for help

\Sexpr[results=rd,stage=render]{if( .Platform$OS.type != 'windows' || .Platform$r_arch != 'x64' ) RcppOctave::o_help(help, format='rd')}

[Generated from Octave-\Sexpr{RcppOctave::o_version()} on \Sexpr{Sys.time()}]

Octave Documentation for doc

\Sexpr[results=rd,stage=render]{if( .Platform$OS.type != 'windows' || .Platform$r_arch != 'x64' ) RcppOctave::o_help(doc, format='rd')}

[Generated from Octave-\Sexpr{RcppOctave::o_version()} on \Sexpr{Sys.time()}]

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
o_help(print)
o_help(rand)
# or equivalently
o_help('rand')

# to include in Rd files, use argument rd=TRUE in an \Sexpr:
## Not run: 
 \Sexpr[results=rd,stage=render]{RcppOctave::o_help(rand, format='rd')}

## End(Not run)

# to see the included Rd code
o_help(rand, format=TRUE)
o_help(rand, format='HTML')
o_help(rand, format='latex')

try({ # may throw an error if Octave documentation is not installed

o_doc(text)
# or equivalently
o_doc('text')

})

RcppOctave documentation built on May 29, 2017, 11:31 a.m.