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

map (maps package)

map(database=”world”, regions=”.”)
Create high quality maps that may be shaded or projected in a variety of ways. While today’s post just covers generating a basic map, additional arguments may be used for coloring in counties, states, or countries (col, fill), looking at different map projections (projection), among many many other options.
  • database – Usually one of four databases: "world", "usa", "state", "county". More databases are available.
  • regions – By default, all regions in the database will be generated. However, specific regions for plotting may be specified using a vector of character strings.

Continue reading

by

by(data, INDICES, FUN, …)
Apply a function across subsets of data, where the subsets are defined by the INDICES argument. The by function returns a list, where each list item represents the results for a particular subset of the data.
  • data – The full set of data, e.g. a vector or data.frame.
  • INDICES – A vector describing how the data subsets are to be constructed (e.g. a factor vector). Multiple columns in a data frame may also be given, where each combination of the variables defines a new subset of data.
  • FUN – A function to apply to each subset of data.
  • – Any additional arguments to pass to FUN.

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

with, within

with(data, expr)
within(data, expr)
Perform R expressions using the items (variables) contained in a list or data frame. The within function will even keep track of changes made, including adding or deleting elements, and return a new object with these revised contents.
  • data – Typically a list or data frame, although other options exist for with.
  • expr – One or more expressions to evaluate using the contents of data (which are accessed directly), where the commands must be wrapped in braces if there is more than one expression to evaluate.

Continue reading