# Contributing

If you are interested you are welcome to contribute to the repository through pull requests.

If you have a strong need for a model that is not covered in this package (and do not want to code it yourself) send me an email or a suggestion in Github

## Short guide/suggestions

TODO The points below are mostly reminders for me but hopefully it can help others

• Use the devtools package to create R files, test files, vignettes etc
• In the R folder:
• bpc.R: this contains a single function (rather large) that is the main function call of the package. We currently have only a single Stan model with lots of optional parameters. These are configured in the main bpc function
• bpc_exports.R: these are helper functions to handle the bpc object and are exposed to the user. Only add here functions that receive a bpc object and that the users will have an interest.
• bpc_get_probabilities.R Get probabilities related functions
• bpc_get_rank_of_players.R Get rank related functions
• bpc_get_parameters.R Get parameters related functions
• bpc_plot.R Functions for possible plots
• bpc_helpers_X.R additional functions to facilitate and support either the bpc function or the exports functions. None of these functions should be exported, although all of them should be documented. We divided these helpers in several files. the indexes are related to creating and checking names and indexes in lookup tables, the hpd to HPDI related functions, the checks to check correct specification of the data frame columns
• bpc_s3.R all functions here are the custom implementation of the generic base functions from R, such as summary, print, predict and plot
• Generated quantities is implemented in the predict function and in the file bpc_btpredict.R
• data-docs.R documentation for the data.
• bpc_object.R declaration and creation of the bpc class.

## Github actions

Currently we rely on few Github actions from r-lib with some modifications to install cmdstanr and cmdstan. Basic code comes from the cmdstanr actions.

• R-CMD-check standard. This checks in windows latest, macOS latest, ubuntu latest and ubuntu devel
• pkgdown. The pkg site is build automatically
• test-coverage. Runs covr automatically and upload to codecov