Description Usage Arguments Value Examples
View source: R/search_versions.R
This function makes it easy to find a version number in an existing set by indexing from another version number. This is particularly useful when you want to know, e.g. what the last development version was before a certain patch version, or what the last minor version was before a certain major version.
1 2 3 4 5 6 | search_versions(
data,
reference,
which = length(reference[[1]]),
increment = -1
)
|
data |
Existing version numbers to search |
reference |
The version number to index from - can be given as a character for convenience. |
which |
The version number part to be cycled through - can either
be supplied as a number or one of the part-names as set in
|
increment |
The number iterations to look forwards/backwards - in most cases this will be -1 to look for the previous version. |
A version number
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | data <- version_number("1.0.0", "1.2.0", "1.2.0.1", "2.0.0")
# Find the previous dev version
search_versions(data, "2.0.0", "dev")
# Find the previous patch version
search_versions(data, "2.0.0", "patch")
# In some cases these will be the same:
search_versions(data, "1.2.0", "dev")
search_versions(data, "1.2.0", "patch")
# If not supplied, the part that gets incremented will be chosen based on
# the specificity of the reference number:
search_versions(data, "2.0.0.0")
search_versions(data, "2.0.0")
# You can use different increments, but usually this isn't needed
search_versions(data, "2.0.0.0", increment = -2)
search_versions(data, "1.0.0", increment = 1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.