CRAN packages have a size limit. One of the benefits of R-universe is to host packages that could never be on CRAN due to size restrictions. Thus, you can exclude the large data from your CRAN package and create a separate data package on R-universe. Then add to Additional_repositories: https://username.r-universe.dev
to DESCRIPTION
. Accoding to the CRAN Repository Policy:
Packages on which a CRAN package depends should be available from a mainstream repository: if any mentioned in ‘Suggests’ or ‘Enhances’ fields are not from such a repository, where to obtain them at a repository should be specified in an ‘Additional_repositories’ field of the DESCRIPTION file (as a comma-separated list of repository URLs) or for other means of access, described in the ‘Description’ field.
If I understand that correctly, R-universe packages can only be in Suggests
(not Imports
or Depends
), so they won't be installed automatically. To install them automatically, would I need to add some sort of a hack like if (!requireNamespace("datapackage")) install.packages("datapackage", repos = "https://username.r-universe.dev")
? Is there a better solution?