findFn (sos package)

findFn(string, maxPages = 20)
Do a search for functions, which opens an interactive HTML page of results. The results may be sorted in a variety of ways and also link to help files for each function. The results page will automatically open in whatever application has been designated to open .html files (usually a browser is the default).
  • string – A character string to search.
  • maxPages – Maximum number of pages to return, i.e. number of links is 20*maxPages.

Continue reading

tar, untar

Use R to create a tarball (tar.gz zip file) or to unzip a tarball.
tar(tarfile, files = NULL)
  • tarfile – Name of the tar.gz file to be generated.
  • files – List of files to be placed into the tarball.
untar(tarfile, exdir = “.”)
  • tarfile – Name of the tar.gz file to be unzipped.
  • exdir – Where to put the files.

Continue reading

all.equal

all.equal(target, current)
Check if two objects are equal, or at least very nearly equal. Don’t get tripped up by the argument names, which make it sound like this function is only for a very specific scenario (convergence) when in truth it can be used for a wide variety of scenarios.
  • target – An R object.
  • current – A second R object to compare to target (the first argument).
As noted in the complete help file, if using all.equal in an if statement, wrap it inside of the isTRUE function.

Continue reading

zapsmall

zapsmall(x, digits = getOption(“digits”)))
If some values of x are nearly zero relative to the larger values in x, then zapsmall will set those small values to zero.
  • x – A numeric vector.
  • digits – An integer indicating the precision.
While not a perfect rule, anticipate values of x that are, in absolute value, less than 1 and are 10^digits smaller than the largest values of x to be set to zero.

Continue reading

sprintf

sprintf(fmt, …)
Create a character string that contains values from R objects. (The sprintf is much more robust than is touched on here, but this will provide sufficient info for a basic start.)
  • fmt – A character string with some occurrences of %s, which will be places that object values are inserted.
  • – The R objects to be inserted. The number of items should correspond to the number of %s occurrences in fmt.

Continue reading