### Install package with configure arguments Source: https://stat.ethz.ch/R-manual/R-devel/RHOME/doc/manual/R-exts.html Command line example for installing a package while passing custom configuration arguments. ```bash R CMD INSTALL \ --configure-args='--with-odbc-include=/opt/local/include \ --with-odbc-lib=/opt/local/lib --with-odbc-manager=iodbc' \ RODBC ``` -------------------------------- ### Install packages with custom configuration Source: https://stat.ethz.ch/R-manual/R-devel/library/utils/help/install.packages.html Example of installing multiple packages while providing specific configuration arguments for one of them. ```R ## Not run: ## A Linux example for Fedora's layout of udunits2 headers. install.packages(c("ncdf4", "RNetCDF"), configure.args = c(RNetCDF = "--with-netcdf-include=/usr/include/udunits2")) ## End(Not run) ``` -------------------------------- ### Implement a basic R front-end in C Source: https://stat.ethz.ch/R-manual/R-devel/RHOME/doc/manual/R-exts.html A minimal example demonstrating the setup for a command-line front-end, including console I/O and signal handling callbacks. ```C #define Win32 #include #include #include #define LibExtern __declspec(dllimport) extern #include #include /* for askok and askyesnocancel */ #include /* for signal-handling code */ #include /* simple input, simple output */ /* This version blocks all events: a real one needs to call ProcessEvents frequently. See rterm.c and ../system.c for one approach using a separate thread for input. */ int myReadConsole(const char *prompt, unsigned char *buf, int len, int addtohistory) { fputs(prompt, stdout); fflush(stdout); if(fgets((char *)buf, len, stdin)) return 1; else return 0; } void myWriteConsole(const char *buf, int len) { printf("%s", buf); } void myCallBack(void) { /* called during i/o, eval, graphics in ProcessEvents */ } void myBusy(int which) { /* set a busy cursor ... if which = 1, unset if which = 0 */ } static void my_onintr(int sig) { UserBreak = 1; } int main (int argc, char **argv) { structRstart rp; Rstart Rp = &rp; char Rversion[25], *RHome, *RUser; ``` -------------------------------- ### Analyze Installed Packages Source: https://stat.ethz.ch/R-manual/R-devel/library/utils/help/installed.packages.html Examples demonstrating how to filter installed packages by priority and extract specific fields like licenses. ```R ## confine search to .Library for speed str(ip <- installed.packages(.Library, priority = "high")) ip[, c(1,3:5)] plic <- installed.packages(.Library, priority = "high", fields = "License") ## what licenses are there: table( plic[, "License"] ) ## Recommended setup (by many pros): ## Keep packages that come with R (priority="high") and all others separate! ## Consequently, .Library, R's "system" library, shouldn't have any ## non-"high"-priority packages : pSys <- installed.packages(.Library, priority = NA_character_) length(pSys) == 0 # TRUE under such a setup ``` -------------------------------- ### Initialize Soap Film Smooth Example Source: https://stat.ethz.ch/R-manual/R-devel/library/mgcv/help/smooth.construct.sf.smooth.spec.html Basic setup for testing soap film smooths using the mgcv package. ```R require(mgcv) ########################## ## simple test function... ########################## ``` -------------------------------- ### example(topic, package = NULL, lib.loc = NULL, character.only = FALSE, give.lines = FALSE, setRNG = FALSE) Source: https://stat.ethz.ch/R-manual/R-devel/library/utils/html/example.html Runs the examples associated with a specific help topic. It can be used to verify package behavior or explore function usage. ```APIDOC ## example(topic, package = NULL, lib.loc = NULL, character.only = FALSE, give.lines = FALSE, setRNG = FALSE) ### Description Runs the examples provided in the help topic for the specified function or dataset. ### Parameters - **topic** (character or name) - Required - The name of the help topic to run examples for. - **package** (character) - Optional - The name of the package where the topic is located. - **lib.loc** (character) - Optional - A character vector of directory names of R libraries. - **character.only** (logical) - Optional - If TRUE, the topic argument is treated as a character string. - **give.lines** (logical) - Optional - If TRUE, returns the lines of code instead of executing them. - **setRNG** (logical) - Optional - If TRUE, sets the random number generator state to ensure reproducibility. ``` -------------------------------- ### Select Installed Packages Source: https://stat.ethz.ch/R-manual/R-devel/library/utils/help/select.list.html An example of using select.list to choose from a sorted list of all available R packages. ```R ## Not run: select.list(sort(.packages(all.available = TRUE))) ## End(Not run) ``` -------------------------------- ### Install Manuals Source: https://stat.ethz.ch/R-manual/R-devel/RHOME/doc/manual/R-admin.html Install additional documentation in info or PDF formats. ```bash make install-info make install-pdf ``` -------------------------------- ### Example Usage of promptPackage Source: https://stat.ethz.ch/R-manual/R-devel/library/utils/help/promptPackage.html Demonstrates generating a documentation shell for the 'utils' package, displaying it, and cleaning up the temporary file. ```R filename <- tempfile() promptPackage("utils", filename = filename) file.show(filename) unlink(filename) ``` -------------------------------- ### Example reference for mono.con Source: https://stat.ethz.ch/R-manual/R-devel/library/mgcv/help/mono.con.html Reference to the pcls documentation for practical application examples. ```R ## see ?pcls ``` -------------------------------- ### Linking Examples for R Front-ends Source: https://stat.ethz.ch/R-manual/R-devel/library/utils/html/LINK.html Examples demonstrating how to link C, Fortran, and C++ programs against R libraries. ```bash ## Not run: ## examples of front-ends linked against R. ## First a C program CC=`R CMD config CC` R CMD LINK $CC -o foo foo.o `R CMD config --ldflags` ## if Fortran code has been compiled into ForFoo.o FLIBS=`R CMD config FLIBS` R CMD LINK $CC -o foo foo.o ForFoo.o `R CMD config --ldflags` $FLIBS ## And for a C++ front-end CXX=`R CMD config CXX` R CMD COMPILE foo.cc R CMD LINK $CXX -o foo foo.o `R CMD config --ldflags` ## End(Not run) ``` -------------------------------- ### Example usage of packageStatus Source: https://stat.ethz.ch/R-manual/R-devel/library/utils/help/packageStatus.html Demonstrates initializing a packageStatus object, printing its summary, and performing package upgrades. ```R x <- packageStatus(repositories = contrib.url(findCRANmirror("web"))) print(x) summary(x) ## Not run: upgrade(x) x <- update(x) print(x) ## End(Not run) ``` -------------------------------- ### Examples of packageName Source: https://stat.ethz.ch/R-manual/R-devel/library/utils/help/packageName.html Demonstrates retrieving the package name for the current environment and the environment of the mean function. ```R packageName() packageName(environment(mean)) ``` -------------------------------- ### Example usage of winDialog Source: https://stat.ethz.ch/R-manual/R-devel/library/utils/help/winDialog.html Demonstrates a simple yes/no dialog box prompt. ```R ## Not run: winDialog("yesno", "Is it OK to delete file blah") ``` -------------------------------- ### Examples of reading registry keys Source: https://stat.ethz.ch/R-manual/R-devel/library/utils/help/readRegistry.html Demonstrates reading registry paths with varying depth and hive specifications. ```R if(.Platform$OS.type == "windows") withAutoprint({ ## only in HLM if set in an admin-mode install. try(readRegistry("SOFTWARE\\R-core", maxdepth = 3)) gmt <- file.path("SOFTWARE", "Microsoft", "Windows NT", "CurrentVersion", "Time Zones", "GMT Standard Time", fsep = "\\") readRegistry(gmt, "HLM") }) ## Not run: ## on a 64-bit R need this to find 32-bit JAGS readRegistry("SOFTWARE\\JAGS", maxdepth = 3, view = "32") ## See if there is a 64-bit user install readRegistry("SOFTWARE\\R-core\\R64", "HCU", maxdepth = 2) ## End(Not run) ``` -------------------------------- ### Example Usage of RGui Menu Functions Source: https://stat.ethz.ch/R-manual/R-devel/library/utils/help/winMenuAddItem.html Demonstrates creating menus, adding items, managing submenus, and querying menu structures. ```R ## Not run: winMenuAdd("Testit") winMenuAddItem("Testit", "one", "aaaa") winMenuAddItem("Testit", "two", "bbbb") winMenuAdd("Testit/extras") winMenuAddItem("Testit", "-", "") winMenuAddItem("Testit", "two", "disable") winMenuAddItem("Testit", "three", "cccc") winMenuAddItem("Testit/extras", "one more", "ddd") winMenuAddItem("Testit/extras", "and another", "eee") winMenuAdd("$ConsolePopup/Testit") winMenuAddItem("$ConsolePopup/Testit", "six", "fff") winMenuNames() winMenuItems("Testit") ## End(Not run) ``` -------------------------------- ### Summarize Rprof output Source: https://stat.ethz.ch/R-manual/R-devel/library/utils/help/summaryRprof.html Demonstrates profiling the glm example and summarizing the results. ```R ## Not run: ## Rprof() is not available on all platforms Rprof(tmp <- tempfile()) example(glm) Rprof() summaryRprof(tmp) unlink(tmp) ## End(Not run) ``` -------------------------------- ### new.packages() Source: https://stat.ethz.ch/R-manual/R-devel/library/utils/help/update.packages.html Identifies uninstalled packages that are available at the repositories and optionally installs them. ```APIDOC ## new.packages() ### Description Compares installed packages with available ones and reports those not currently installed. If ask is not FALSE, it prompts the user to install selected packages. ### Parameters - **ask** (logical) - Optional - Whether to prompt the user to install the identified packages. ### Response - **Returns** (character vector) - A vector of package names that remain uninstalled after the operation. ``` -------------------------------- ### install.packages Source: https://stat.ethz.ch/R-manual/R-devel/library/utils/html/install.packages.html Installs R packages from a repository or local file, supporting various binary and source types. ```APIDOC ## install.packages ### Description Installs R packages from a repository or local file. It supports binary and source package types and provides configuration for installation locking and source checking. ### Parameters - **type** (string) - Optional - The type of package to install. Options include "binary", "source", or "both". Binary types can be platform-specific (e.g., "win.binary", "mac.binary.big-sur-arm64"). - **lock** (boolean/string) - Optional - Controls locking behavior during installation. Defaults vary by platform and installation type (e.g., per-directory or per-package locking). ### Configuration Options - **install.packages.check.source** (option) - Set to "no" to suppress checks for newer source versions when installing binary packages. - **install.packages.compile.from.source** (option) - Controls behavior when source packages require compilation. - **install.lock** (option) - Sets the default locking behavior for binary installs. ``` -------------------------------- ### example(topic, package = NULL, lib.loc = NULL, character.only = FALSE, give.lines = FALSE, local = FALSE, echo = TRUE, verbose = getOption("verbose"), setRNG = FALSE, ask = getOption("example.ask"), ...) Source: https://stat.ethz.ch/R-manual/R-devel/library/utils/help/example.html Runs the examples provided in the help topic for a specified function or dataset. ```APIDOC ## example(topic, ...) ### Description Runs the examples found in the help page for the specified topic. This is useful for demonstrating how a function or dataset is intended to be used. ### Parameters - **topic** (character or name) - Required - The name of the help topic to run examples for. - **package** (character) - Optional - The name of the package where the topic is located. - **lib.loc** (character) - Optional - A character vector of directory names of R libraries. - **setRNG** (logical) - Optional - If TRUE, the random number generator state is saved before running the example and restored afterwards. - **give.lines** (logical) - Optional - If TRUE, returns the lines of code instead of executing them. ### Usage Example ```r # Run examples for a dataset example(InsectSprays) # Run examples from a specific package example("smooth", package = "stats") # Run examples with RNG state preservation r1 <- example(quantile, setRNG = TRUE) ``` ``` -------------------------------- ### Generate R documentation files Source: https://stat.ethz.ch/R-manual/R-devel/library/utils/help/prompt.default.html Examples demonstrating how to create documentation shells for various R objects and clean up the generated files. ```R require(graphics) prompt(plot.default) prompt(interactive, force.function = TRUE) unlink("plot.default.Rd") unlink("interactive.Rd") prompt(women) # data.frame unlink("women.Rd") prompt(sunspots) # non-data.frame data unlink("sunspots.Rd") ## Not run: ## Create a help file for each function in the .GlobalEnv: for(f in ls()) if(is.function(get(f))) prompt(name = f) ## End(Not run) ``` -------------------------------- ### Example Usage of promptData Source: https://stat.ethz.ch/R-manual/R-devel/library/utils/help/promptData.html Demonstrates generating a documentation file for the sunspots data set and subsequently removing the generated file. ```R promptData(sunspots) unlink("sunspots.Rd") ``` -------------------------------- ### Example of shortPathName usage Source: https://stat.ethz.ch/R-manual/R-devel/library/utils/help/shortPathName.html Demonstrates converting R home and temporary directory paths to short form on Windows systems. ```R if(.Platform$OS.type == "windows") withAutoprint({ cat(shortPathName(c(R.home(), tempdir())), sep = "\n") }) ``` -------------------------------- ### Example of reading a startup file Source: https://stat.ethz.ch/R-manual/R-devel/library/base/help/readRenviron.html Demonstrates how to read a user-specific .Renviron file. ```R ## Not run: ## re-read a startup file (or read it in a vanilla session) readRenviron("~/.Renviron") ## End(Not run) ``` -------------------------------- ### Display a Remote Text File Source: https://stat.ethz.ch/R-manual/R-devel/library/utils/help/url.show.html Example of fetching and displaying a text file from a URL. ```R ## Not run: url.show("https://www.stats.ox.ac.uk/pub/datasets/csb/ch3a.txt") ``` -------------------------------- ### Stack and Unstack Data Examples Source: https://stat.ethz.ch/R-manual/R-devel/library/utils/help/stack.default.html Demonstration of unstacking the PlantGrowth dataset and restacking it, including selective stacking. ```R require(stats) formula(PlantGrowth) # check the default formula pg <- unstack(PlantGrowth) # unstack according to this formula pg stack(pg) # now put it back together stack(pg, select = -ctrl) # omitting one vector ``` -------------------------------- ### Example of relist workflow Source: https://stat.ethz.ch/R-manual/R-devel/library/utils/help/relist.list.html Complete workflow showing conversion to a relistable object, unlisting, and restoring the original structure. ```R ipar <- list(mean = c(0, 1), vcov = cbind(c(1, 1), c(1, 0))) initial.param <- as.relistable(ipar) ul <- unlist(initial.param) relist(ul) stopifnot(identical(relist(ul), initial.param)) ``` -------------------------------- ### Arrange Windows Usage Examples Source: https://stat.ethz.ch/R-manual/R-devel/library/utils/help/arrangeWindows.html Demonstrates basic window tiling and how to customize the target windows using the .arrangeWindowsDefaults list. ```R ## Not run: ## Only available on Windows : arrangeWindows("v") # This default is useful only in SDI mode: it will tile any Firefox window # along with the R windows .arrangeWindowsDefaults <- list(c("R", "all"), pattern = c("", "Firefox")) arrangeWindows("v") ## End(Not run) ``` -------------------------------- ### Examples of reading SAS datasets Source: https://stat.ethz.ch/R-manual/R-devel/library/foreign/help/read.ssd.html Demonstrates reading files from a directory and a Windows-specific path example. Requires a local SAS installation. ```R ## if there were some files on the web we could get a real ## runnable example ## Not run: R> list.files("trialdata") [1] "baseline.sas7bdat" "form11.sas7bdat" "form12.sas7bdat" [4] "form13.sas7bdat" "form22.sas7bdat" "form23.sas7bdat" [7] "form3.sas7bdat" "form4.sas7bdat" "form48.sas7bdat" [10] "form50.sas7bdat" "form51.sas7bdat" "form71.sas7bdat" [13] "form72.sas7bdat" "form8.sas7bdat" "form9.sas7bdat" [16] "form90.sas7bdat" "form91.sas7bdat" R> baseline <- read.ssd("trialdata", "baseline") R> form90 <- read.ssd("trialdata", "form90") ## Or for a Windows example sashome <- "/Program Files/SAS/SAS 9.1" read.ssd(file.path(sashome, "core", "sashelp"), "retail", sascmd = file.path(sashome, "sas.exe")) ## End(Not run) ``` -------------------------------- ### Examples of reading fixed-width files Source: https://stat.ethz.ch/R-manual/R-devel/library/utils/help/read.fwf.html Demonstrates reading files with various width configurations, including skipping columns and handling multiline records. ```R ff <- tempfile() cat(file = ff, "123456", "987654", sep = "\n") read.fwf(ff, widths = c(1,2,3)) #> 1 23 456 \ 9 87 654 read.fwf(ff, widths = c(1,-2,3)) #> 1 456 \ 9 654 unlink(ff) cat(file = ff, "123", "987654", sep = "\n") read.fwf(ff, widths = c(1,0, 2,3)) #> 1 NA 23 NA \ 9 NA 87 654 unlink(ff) cat(file = ff, "123456", "987654", sep = "\n") read.fwf(ff, widths = list(c(1,0, 2,3), c(2,2,2))) #> 1 NA 23 456 98 76 54 unlink(ff) ``` -------------------------------- ### Override R_JAVA_LD_LIBRARY_PATH Source: https://stat.ethz.ch/R-manual/R-devel/RHOME/doc/manual/R-admin.html Setting the environment variable before starting R to support installed Java packages. ```bash R_JAVA_LD_LIBRARY_PATH=/usr/lib/jvm/java-1.8.0/jre/lib/amd64/server ``` -------------------------------- ### Retrieve R Home Directory Source: https://stat.ethz.ch/R-manual/R-devel/library/base/help/R.home.html Basic usage of R.home to get the root installation directory. ```R R.home(component = "home") ``` -------------------------------- ### browseURL Examples Source: https://stat.ethz.ch/R-manual/R-devel/library/utils/help/browseURL.html Examples demonstrating how to configure the default browser and open specific URLs or local files. ```R ## Not run: ## for KDE users who want to open files in a new tab options(browser = "kfmclient newTab") browseURL("https://www.r-project.org") ## On Windows-only, something like browseURL("file://d:/R/R-2.5.1/doc/html/index.html", browser = "C:/Program Files/Mozilla Firefox/firefox.exe") ## End(Not run) ``` -------------------------------- ### packageStatus(lib.loc = NULL, repositories = NULL, method, type = getOption("pkgType"), ...) Source: https://stat.ethz.ch/R-manual/R-devel/library/utils/help/packageStatus.html Summarizes information about installed packages and packages available at various repositories. ```APIDOC ## packageStatus ### Description Summarize information about installed packages and packages available at various repositories. ### Arguments - **lib.loc** (character vector) - Optional - Location of R library trees to search through. - **repositories** (character vector) - Optional - URLs describing the location of R package repositories. - **method** (string) - Optional - Download method, see download.file. - **type** (string) - Optional - Type of package distribution. - **...** - Optional - Arguments to be passed to available.packages and installed.packages. ``` -------------------------------- ### Generating Tags for a Repository Source: https://stat.ethz.ch/R-manual/R-devel/library/utils/help/rtags.html Example of generating a TAGS file for a specific directory path with recursive file searching. ```R ## Not run: rtags("/path/to/src/repository", pattern = "[.]*\\.[RrSs]$", keep.re = "/R/", verbose = TRUE, ofile = "TAGS", append = FALSE, recursive = TRUE) ## End(Not run) ``` -------------------------------- ### Configure .Renviron and .Rprofile settings Source: https://stat.ethz.ch/R-manual/R-devel/library/base/help/Rprofile.site.html Examples for setting environment variables and R options during startup. ```R ## Not run: ## Example ~/.Renviron on Unix R_LIBS=~/R/library PAGER=/usr/local/bin/less ## Example .Renviron on Windows R_LIBS=C:/R/library MY_TCLTK="c:/Program Files/Tcl/bin" # Variable expansion in double quotes, string literals with backslashes in # single quotes. R_LIBS_USER="${APPDATA}"'\R-library' ## Example of setting R_DEFAULT_PACKAGES (from R CMD check) R_DEFAULT_PACKAGES='utils,grDevices,graphics,stats' # this loads the packages in the order given, so they appear on # the search path in reverse order. ## Example of .Rprofile options(width=65, digits=5) options(show.signif.stars=FALSE) setHook(packageEvent("grDevices", "onLoad"), function(...) grDevices::ps.options(horizontal=FALSE)) set.seed(1234) .First <- function() cat("\n Welcome to R!\n\n") .Last <- function() cat("\n Goodbye!\n\n") ## Example of Rprofile.site local({ # add MASS to the default packages, set a CRAN mirror old <- getOption("defaultPackages"); r <- getOption("repos") r["CRAN"] <- "http://my.local.cran" options(defaultPackages = c(old, "MASS"), repos = r) ## (for Unix terminal users) set the width from COLUMNS if set cols <- Sys.getenv("COLUMNS") if(nzchar(cols)) options(width = as.integer(cols)) # interactive sessions get a fortune cookie (needs fortunes package) if (interactive()) fortunes::fortune() }) ## if .Renviron contains FOOBAR="coo\bar"doh\ex"abc\"def'" ## then we get # > cat(Sys.getenv("FOOBAR"), "\n") # coo\bardoh\exabc"def' ## End(Not run) ``` -------------------------------- ### Get Windows Handle Example Source: https://stat.ethz.ch/R-manual/R-devel/library/utils/help/getWindowsHandle.html Conditional check to print the Windows handle if the operating system is Windows. ```R if(.Platform$OS.type == "windows") print( getWindowsHandle() ) ``` -------------------------------- ### Examples of Using the page Function Source: https://stat.ethz.ch/R-manual/R-devel/library/utils/help/page.html Demonstrates various ways to invoke the page function, including passing objects directly, using character strings, or specifying namespaces. ```R ## Not run: ## four ways to look at the code of 'page' page(page) # as an object page("page") # a character string v <- "page"; page(v) # a length-one character vector page(utils::page) # a call ## End(Not run) ``` -------------------------------- ### Profiling Memory Allocation Source: https://stat.ethz.ch/R-manual/R-devel/library/utils/help/Rprofmem.html Example demonstrating how to start profiling, run a task, and stop the profiler to inspect the output. ```R ## Not run: ## not supported unless R is compiled to support it. Rprofmem("Rprofmem.out", threshold = 1000) example(glm) Rprofmem(NULL) noquote(readLines("Rprofmem.out", n = 5)) ## End(Not run) ``` -------------------------------- ### Examples of make.packages.html Source: https://stat.ethz.ch/R-manual/R-devel/library/utils/help/make.packages.html.html Demonstrates basic usage and an interactive call with specific library locations. ```R ## Not run: make.packages.html() # this can be slow for large numbers of installed packages. ## End(Not run) if(interactive()) # typically fast and quiet make.packages.html(lib.loc = .Library, verbose=FALSE) ``` -------------------------------- ### Example of Getting and Setting Working Directory Source: https://stat.ethz.ch/R-manual/R-devel/library/base/help/getwd.html Demonstrates capturing the current working directory and restoring it using setwd. ```R (WD <- getwd()) if (!is.null(WD)) setwd(WD) ``` -------------------------------- ### Set R_DEFAULT_PACKAGES Source: https://stat.ethz.ch/R-manual/R-devel/library/base/help/.Rprofile.html Example of defining default packages to load at startup. ```text ## Example of setting R_DEFAULT_PACKAGES (from R CMD check) R_DEFAULT_PACKAGES='utils,grDevices,graphics,stats' # this loads the packages in the order given, so they appear on # the search path in reverse order. ``` -------------------------------- ### Retrieve R variable value Source: https://stat.ethz.ch/R-manual/R-devel/RHOME/doc/manual/R-exts.html Example implementation of retrieving a variable from an environment, equivalent to R's get(). ```c SEXP getvar(SEXP name, SEXP rho) { SEXP ans; if (!Rf_isString(name) || Rf_length(name) != 1) Rf_error("name is not a single string"); if (!Rf_isEnvironment(rho)) Rf_error("rho should be an environment"); ans = R_getVar(Rf_installChar(STRING_ELT(name, 0)), rho, TRUE); if (TYPEOF(ans) != REALSXP || Rf_length(ans) == 0) Rf_error("value is not a numeric vector with at least one element"); Rprintf("first value is %f\n", REAL(ans)[0]); return R_NilValue; } ``` -------------------------------- ### Examples of get and mget usage Source: https://stat.ethz.ch/R-manual/R-devel/library/base/help/dynGet.html Demonstrates retrieving objects, handling missing values with mget, and inspecting missing arguments. ```R get("%o%") ## test mget e1 <- new.env() mget(letters, e1, ifnotfound = as.list(LETTERS)) ## very low-level: get()ing the "missing argument", e.g., inside browser() ls.str(E <- environment((\(m) \(){})())) # m : str(E$m) # (empty) symbol ee <- tryCatch(get("m",E), error = function(e) e) str(ee) ee stopifnot(exprs = { inherits(ee, "missingArgError") # and inherits(ee, "getMissingError") ## inherits(tryCatch(get0("m", E), error=identity), "getMissingError") is.symbol(E$m) # => valid argument to get(), and *also* gets 'missing arg': inherits(tryCatch(get ( E$m ) , error=identity), "getMissingError") }) ``` -------------------------------- ### help.start(update = FALSE, gui = "irrelevant", lib.loc = .libPaths(), browser = getOption("browser"), remote = NULL, verbose = getOption("verbose")) Source: https://stat.ethz.ch/R-manual/R-devel/library/utils/help/help.start.html Starts the hypertext (HTML) version of R's online documentation. ```APIDOC ## help.start() ### Description Starts the hypertext (currently HTML) version of R's online documentation. ### Arguments - **update** (logical) - Optional - Should this attempt to update the package index to reflect the currently available packages. - **gui** (character) - Optional - Just for compatibility with S-PLUS. - **lib.loc** (character vector) - Optional - Listing the package libraries to be included. - **browser** (character or function) - Optional - The name of the program to be used as hypertext browser, or an R function called with a URL. - **remote** (character) - Optional - A valid URL for the ‘R_HOME’ directory on a remote location. - **verbose** (logical) - Optional - Indicates if information about the system interface should be printed to the console. ### Examples help.start() ## the 'remote' arg can be tested by help.start(remote = paste0("file://", R.home())) ```