viewCode: View Package R Code

View source: R/supportFuns.r

viewCodeR Documentation

View Package R Code

Description

View the R code of all functions in a specified package installed on the user's system.

Usage

viewCode(pkg="PBSmodelling", funs, output=4, ...)

Arguments

pkg

string name of a package installed on the user's computer.

funs

string vector of explicit function names from pkg to view.

output

numeric value: 1 = function names only, 2 = function names with brief description, 3 = functions and their arguments, and 4 = function R-code (default).

...

allows user to specify two additional arguments for output=2:
remote - character string giving a valid URL for the R_HOME directory on a remote location;
update - logical: if TRUE, attempt to update the package index to reflect the currently available packages. (Not attempted if remote is non-NULL.)

Also, if user specifies pat=TRUE, then funs, if specified, are treated like patterns.

Details

If funs is not specified, then all functions, including hidden (dot) functions are displayed.
If the package has a namespace, functions there are also displayed.

Value

Invisibly returns source code of all functions in the specified package. The function invokes openFile to display the results.

Note

Output type 2 (function name with brief description) will now only work in R (>=3.2.0) or from SVN revision >= 67548. The CRAN gurus now disallow direct calls to tools:::httpdPort.

Author(s)

Rowan Haigh, Pacific Biological Station, Fisheries and Oceans Canada, Nanaimo BC

See Also

showHelp, view


PBSmodelling documentation built on Nov. 9, 2023, 5:07 p.m.