| 1 |
\name{shortRversion} |
| 2 |
\alias{shortRversion} |
| 3 |
\title{Short R Version String} |
| 4 |
\description{ |
| 5 |
From \pkg{base} \R's \code{\link{R.version.string}}, produce a somewhat |
| 6 |
shorter version, with or without date, notably also for \emph{patched} or |
| 7 |
\emph{devel}opment versions of \R. |
| 8 |
|
| 9 |
Main use is for plotting or construction of file of variable names. |
| 10 |
} |
| 11 |
\usage{ |
| 12 |
shortRversion(Rv = R.version, Rst = Rv$status, |
| 13 |
Rvstring = if (!is.null(s <- Rv$version.string)) s else R.version.string, |
| 14 |
date = Rst != "", spaces = TRUE) |
| 15 |
} |
| 16 |
\arguments{ |
| 17 |
\item{Rv}{a \code{\link{list}} with some of the same components as \code{\link{R.version}}.} |
| 18 |
\item{Rst}{a string specifying the \emph{status} of \R's version. For |
| 19 |
released versions of \R, this is \code{""}; almost always use the default \code{Rv$status}.} |
| 20 |
\item{Rvstring}{a string with a default that should work even for \R |
| 21 |
versions previous to 1.0.0.} |
| 22 |
\item{date}{logical specifying if the date of the \R version should be |
| 23 |
included in the result; by default, this will be true only for |
| 24 |
non-released versions of \R.} |
| 25 |
\item{spaces}{logical indicating if the result may contain spaces (aka |
| 26 |
\sQuote{blanks}); setting it to false, replaces the blanks by \code{"-"} and \code{"_"}.} |
| 27 |
} |
| 28 |
\value{ |
| 29 |
a \code{\link{character}} string, typically a shortened version of \code{Rvstring}. |
| 30 |
} |
| 31 |
\author{Martin Maechler} |
| 32 |
\seealso{ |
| 33 |
\code{\link{R.version}}, \code{\link{R.version.string}} |
| 34 |
} |
| 35 |
\examples{ |
| 36 |
shortRversion() ## (including the date, typically for an R Core developer) |
| 37 |
## but this is shorter: |
| 38 |
(Rver <- shortRversion(date=FALSE)) |
| 39 |
shortRversion(spaces=FALSE)# e.g. for a file of even directory name |
| 40 |
shortRversion(spaces=FALSE, date=FALSE)# even shorter, ditto |
| 41 |
|
| 42 |
## If you want even shorter { abbreviate() will remove spaces, too }: |
| 43 |
abbreviate(shortRversion(), 11) |
| 44 |
abbreviate(shortRversion(date=FALSE), 13) |
| 45 |
} |
| 46 |
\keyword{utilities} |