Get a suitable Rocker image based on the R version. Needs network access to retrieve the available images.

getImageForVersion(r_version, nearest = TRUE)

Arguments

r_version

A string representation of the R version, e.g. "3.4.2"

nearest

A boolean, should the closest version be returned if there is no match?

Value

A string with the name of the Docker image

Details

If there was no matching image found, a warning is issued.

Examples

getImageForVersion(getRVersionTag(utils::sessionInfo()))
#> An object of class "From" #> Slot "image": #> [1] "rocker/r-ver" #> #> Slot "postfix": #> An object of class "Tag" #> [1] "3.6.1" #>
getImageForVersion("3.4.3")
#> An object of class "From" #> Slot "image": #> [1] "rocker/r-ver" #> #> Slot "postfix": #> An object of class "Tag" #> [1] "3.4.3" #>