gh {mmstat4} | R Documentation |
gh functions
Description
The function gh
carries out the following operation on a file named x
.
It searches for a match for x
within the active repository, utilizing fuzzy string
matching. If no unique match is identified, an error is thrown along with suggestions for
potential "best" matches.
Otherwise, the following operation are performed:
-
gh(x, 'open')
orghopen(x)
: Opens a file in the local browser if the file extension ishtml
orpdf
, otherwise in the RStudio editor. -
gh(x, 'load')
orghload(x)
: Loads the contents of a file withimport
. -
gh(x, 'source')
orghsource(x)
: Executes the contents of a file withsource
. -
gh(x, 'app')
orghapp(x)
: Tries to open the file with the default application of the OS, seedefaultApp()
. -
ghdata(x, pkg)
: Helper function to load data sets from R packages into Python, simulatespkg::x
.
Usage
gh(x, what = c("open", "load", "source", "app"), ..., .call = NULL)
ghopen(x, ...)
ghload(x, ...)
ghsource(x, ...)
ghapp(x, ...)
Arguments
x |
character(1): name of the file, app or data set |
what |
character or function: a name of a predefined function or another function. The function must have a formal parameter |
... |
further parameters used in |
.call |
the original function call (default: |
Value
invisibly the result of utils::browseURL, openFile()
, rio::import()
, or base::source()
.
Examples
if (interactive()) {
x <- ghopen("bank2.SAV")
x <- ghload("bank2.SAV")
str(x)
x <- ghsource("univariate/example_ecdf.R")
}