shortRversion function

Short R Version String

Short R Version String

From base 's R.version.string, produce a somewhat shorter version, with or without date, notably also for patched or development versions of .

Main use is for plotting or construction of file of variable names.

shortRversion(Rv = R.version, Rst = Rv$status, Rvstring = if (!is.null(s <- Rv$version.string)) s else R.version.string, date = Rst != "", spaces = TRUE)

Arguments

  • Rv: a list with some of the same components as R.version.

  • Rst: a string specifying the status of 's version. For released versions of , this is ""; almost always use the default Rv$status.

  • Rvstring: a string with a default that should work even for

    versions previous to 1.0.0.

  • date: logical specifying if the date of the version should be included in the result; by default, this will be true only for non-released versions of .

  • spaces: logical indicating if the result may contain spaces (aka blanks ); setting it to false, replaces the blanks by "-" and "_".

Returns

a character string, typically a shortened version of Rvstring.

Author(s)

Martin Maechler

See Also

R.version, R.version.string

Examples

shortRversion() ## (including the date, typically for an R Core developer) ## but this is shorter: (Rver <- shortRversion(date=FALSE)) shortRversion(spaces=FALSE)# e.g. for a file of even directory name shortRversion(spaces=FALSE, date=FALSE)# even shorter, ditto ## If you want even shorter { abbreviate() will remove spaces, too }: abbreviate(shortRversion(), 11) abbreviate(shortRversion(date=FALSE), 13)
  • Maintainer: Martin Maechler
  • License: GPL (>= 2)
  • Last published: 2024-11-05