CRAN package version guidelines

From what I understand, CRAN packages are ideally supposed to follow semantic versioning (X.Y.Z) similar to R itself. However, other version schemes exist. For example, RStudio uses calendar-based versioning (YYYY.MM.patch). A long time ago, I tried to submit a package to CRAN and there was a problem with the version formatting (2022.01 did not work, but 22.1 was okay). Now I cannot seem to find these rules. Are they explicitly stated somewhere? And more specifically, which variants of calendar versioning are acceptable for CRAN packages?

x.y.z is implicitly required (I couldn't find a definite statement either) because of the rule that each version must be incremented by one. Bioconductor is clearer about what the rules are.

I think most people prefer x.y.z versioning, but it is not required by CRAN. x.y is fine as well, or x.y.z.zz, etc:

❯ package_version("1.2")
[1] ‘1.2’

❯ package_version("1.2.3.4")
[1] ‘1.2.3.4’

AFAIK calendar versions are allowed as well, but 2022.01 is the same as 2011.1:

 ❯ package_version("2022.01")
[1] ‘2022.1’
1 Like

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.