Why are the versioning schemes 0-based when R itself is 1-based?

I am nitpicking here, but please bear with me. According to the R Packages book,

A released version number consists of three numbers, <major>.<minor>.<patch>. For version number 1.9.2, 1 is the major number, 9 is the minor number, and 2 is the patch number. Never use versions like 1.0. Always spell out the three components, 1.0.0.

Regardless of the exact versioning scheme, major/minor/patch numbering starts at 0, whether it's 1.0.0 or 0.0.0.9000. What bothers me is that R is 1-based (array indexes start at 1, the first element is at index 1). Shouldn't versions of R and R packages adhere to 1-based system?

History and tradition. Alternatively versions are character, not numeric.

3 Likes

In semantic versioning usually a major release is reserved when the product is stable and ready for the public.
You could start writing your package version with 1, but at the end of the day it is just a (weak) signal of how do you perceive the package.

R accepts the following:

The mandatory β€˜Version’ field gives the version of the package. This is a sequence of at least two (and usually three) non-negative integers separated by single β€˜.’ or β€˜-’ characters. The canonical form is as shown in the example, and a version such as β€˜0.01’ or β€˜0.01.0’ will be handled as if it were β€˜0.1-0’. It is not a decimal number, so for example 0.9 < 0.75 since 9 < 75.

As such other versioning schemes are accepted. There are some CRAN packages that use dates for versioning like 2023.07.17

3 Likes

The major version number is incremented when there are significant changes to the API or when the project is not backwards compatible. The mirror version number is incremented when new features are added to the project, but the API remain backwards compatible. The patch version number is incremented when there are bug fixes or other minor changes to the project.

This topic was automatically closed after 45 days. New replies are no longer allowed.


If you have a query related to it or one of the replies, start a new topic and refer back with a link.