Latest CRAN version of package masked by earlier one
Closed this issue · 6 comments
Package pomp is in version 1.10 on CRAN, yet the default RDocumentation link is to 1.4.1.1. One can bypass this, of course, by explicitly giving the desired version number (à la https://www.rdocumentation.org/packages/pomp/versions/1.10) , but shouldn't the default be to the latest version? This seems like a bug.
Seems like a bug indeed, it seems that the package uses different versioning scheme 1.4.1.1
, 1.10
, 0.65-1
, ... and this may confuse the sorting. I'll see what I can do about that, thanks for raising.
Yes, sorry about that. For what it's worth, I think I've settled on a rational scheme for version numbering at last. Better late than never!
If you point me toward the piece of code that sorts the CRAN versions, I can attempt a pull request to fix this problem.
@kingaa, it's on https://github.com/datacamp/RDocumentation-app.
The logic is in api/models/PackageVersion.js
, if I'm not mistaken.
Thanks. I notice lines 138-144 of api/models/PackageVersion.js
:
getLatestVersion:function(packageName){
return PackageVersion.findOne({
where:{package_name:packageName},
order: [[sequelize.fn('ORDER_VERSION', sequelize.col('PackageVersion.version')), 'DESC' ]]
});
}
I was imagining that it would be a relatively simple matter of teaching RDocumentation-app to use the same package ordering that R uses, i.e., lexical ordering. However, I don't see anywhere within the package that the ordering of version numbers is specified. Do you know where this is done?
The ordering logic has been revised, https://www.rdocumentation.org/packages/pomp
correctly goes to the latest version