This page explains how to submit R packages and R projects to SwissStatsR.org.

Click here to make a submission
[^1]: The use of GitHub is recommended to ease collaboration and leverage R-CMD-Check GitHub Actions.
usethis::use_gpl3_license()
Contact information can be found in the About section.
Click here to make a submission
Your R package should follow best practices. See "R package (2e)" free online book.
The R package should have an open source license such as MIT, GPL or LGPL:
usethis::use_gpl3_license(), usethis::use_mit_license(), etc.The R package should have an GitHub Action R-CMD-Check badge:
usethis::use_github_action()SwissStatsR hosts only R projects passing all R-CMD-Checks.
If you have R scripts related to Swiss statistics which could be useful to the R community, you can submit an GitHub repository containing R scripts.
The following GitHub repository is an example of an SwissStatsR project:
DESCRIPTION fileYour repository should contains metadata about your project in a DESCRIPTION file. Even if your project is not an R package, this file helps us standardize metadata collection among all SwissStatsR projects, such as contacts and licensing.
You can create the DESCRIPTION file with:
usethis::use_description()
Then you should fill DESCRIPTION file. You can use utility functions as
helpers, such as:
usethis::use_author()
usethis::use_gpl3_license(), usethis::use_mit_license(), etc.We ask you to also add R package dependencies of your R project. As a
helper, you can use usethis::use_package().
/R folderWe strongly recommend to have all the R function in the /R folder,
following R package guidelines. Some reasons are:
devtools::load_all(), it is really easy to setup the environment.golem (R shiny) and targets./tests folderAll tests should be in the /tests folder. More information about tests can be found (here)[https://r-pkgs.org/testing-basics.html].
Other R scripts and files can be added to the /inst and /scripts folders.
If for some reasons the R projects cannot follow an R package structure, all
the other files and folders should be listed in the .Rbuildignore file.
For this you can use:
usethis::use_build_ignore()
If you R project contains R functions and tests, we recommend you to add them in the "R" and "tests" folder and follow R package guidelines.
.gitignore fileYou can avoid sharing specific files and folder using the .gitignore file, in
particular sensitive files.
Please note as you are the only responsible of the data shared on GitHub.
We strongly recommend you to use renv to track the dependencies of your R project with snapshots. Snapshots should be done using the most R version possible.
renv::init()
You can choose to add a specific badge in the README showing your R project is fully
reproducible using renv.
Even if your R project is not an R package, we ask you to add GitHub Actions
R-CMD-Check to check if your DESCRIPTIONS and .Rbuildignore files are
correctly filled. For this, please use usethis::use_github_action(name = "check-standard")
You can locally check your R project R-CMD-Check results with: devtools::check().
SwissStatsR hosts only R projects passing all R-CMD-Checks.