inst/doc/contribution.md

To contribute to this package

Organisation

R package organisation is quite straigth forward:

R functions convention

Documentation

Each function are preceded by ROxygen comment to render the documentation of each function. To transfer those ROxygen comment to Rd files in the man folder, run:

devtools::document()

Writing

One good guidelines that could be followed is the one from the TidyVerse. It explains how to name files, functions, variable, for analyses and packages. It also add information on how to nicely write the code: space, indentations, ...

All those guidelines can be automatically detected and applied to a package with styler package.

Testing

One objective would be to add tests for each functions and for each conditions. For that we use the package test_that. For a given function a linked test file can be created in the test/testthat/ folder with

use_test("function_name")

When the test is added inside the file it will be ran during compilation or can be done with:

devtools::test()   

To see the coverage of the generated code you can use:

library(covr)

# If run with no arguments implicitly calls `package_coverage()`
report()


sinnweja/kinship2 documentation built on July 8, 2023, 11:26 p.m.