shortRversion: Short R Version String

View source: R/sessionInfo-ext.R

shortRversionR Documentation

Short R Version String

Description

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

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

Usage

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 R's version. For released versions of R, this is ""; almost always use the default Rv$status.

Rvstring

a string with a default that should work even for R versions previous to 1.0.0.

date

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

spaces

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

Value

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)

sfsmisc documentation built on Sept. 11, 2024, 6:53 p.m.