Description Usage Arguments Value Examples
View source: R/reset_version.R
Reset the version field. "Major", "minor" and "patch" fields are set as integers, "prerelease" and "build" are set with character strings. Fields of lower precedence are reset to default value (0L or "")
1 2 3 4 5 6 7 8 | reset_version(x, field, value, ...)
## S3 method for class 'svptr'
reset_version(x, field = c("major", "minor", "patch",
"prerelease", "build"), value, ...)
## S3 method for class 'svlist'
reset_version(x, field, value, ...)
|
x |
An object of class "svlist" or "svptr". |
field |
For the "svptr" class a character string detailing the field to set (major, minor etc...). For the "svlist" class a character vector detailing the field to set for each list member. |
value |
The value to set the field to. For fields "major", "minor" and "patch" this is an integer. For fields "prerelease" and "build" this is a character. For the "svptr" class value is a scalar. For the "svlist" class value is a list detailing the value to set for each list member. |
... |
Additional arguments passed on to methods. |
returns an object of class svptr or svlist
1 2 3 4 5 | semver <- parse_version(c("1.2.3", "1.2.4-alpha+bld1"))
reset_version(semver[[2]], "major", 1L)
semver[[1]] <- reset_version(semver[[1]], "major", 2L)
reset_version(semver, c("minor", "prerelease"), list(3L, "beta"))
reset_version(semver, c("prerelease"), list("hello", "world"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.