Feedback and Information for Developers

We welcome and encourage to post a GitHub issue with any comments, ideas and questions about datelife's software and website. If you want to contribute with code directly, we welcome and encourage pull requests.

Function documentation:

Package and function documentation was generated with roxygen2:

roxygen2::roxygenise()

Styling code:

We used the package lintr to check for coding style:

lintr::lint_package()

Calculating test coverage:

Code coverage was calculated with the package covr:

cov <- covr::package_coverage()

usethis::use_data(cov, overwrite = TRUE)

You can see an interactive report of testing coverage:

covr::report(cov)

And, find code with zero coverage:

covr::zero_coverage(cov)

Generating datelife's hexsticker:

Code used to generate current datelife's logo hexsticker is in data-raw/hexsticker-current.R

Rendering the vignettes:

Vignettes are rendered automatically upon built. However, if you wish to see how they look rendered before releasing the package, you can do this with knitr::knit(). The following command renders the vignette Getting_started_with_datelife as html:

knitr::knit("vignettes/Getting_started_with_datelife.Rmd")

To update "pre-rendered" vignettes, follow this blog. For example, to render the vignette about making trees with BOLD, do:

knitr::knit("vignettes/making_bold_trees.Rmd.orig", output = "vignettes/making_bold_trees.Rmd")

Creating a documentation website for the package

Using pkgdown for this is quite straightforward and fun:

usethis::use_pkgdown()
pkgdown::build_site()

Preparing a CRAN release

Updating GitHub actions R CMD check

Run the following function from the package usethis to update R CMD Check on GitHub:

usethis::use_github_action_check_standard()

This downloads the standard R CMD check workflow from r-lib action examples.

Local checks

To be able to release to CRAN, the first step is to pass the checks locally. To run a local check, you can use the command R CMD check from your terminal. For that, change directories to the one above your working clone of the datelife repo:

cd ../

Generate a tar ball for your package by running R CMD build package-name:

R CMD build datelife

Finally, run R CMD check package-tar-ball on the tar ball that you just generated:

R CMD check --as-cran datelife_0.6.0.tar.gz
Remote checks

If you do not have access to different OS to test your package on, the rhub package allows remote testing on a variety of OS with the command:

rhub::check_for_cran(platforms = "debian-gcc-release")
rhub::check_for_cran(platforms = "fedora-clang-devel")

For more rhub useful workflows, check out its documentation. For example

previous_checks <- rhub::list_package_checks(".",
                                  email = "sanchez.reyes.luna@gmail.com",
                                  howmany = 4)
group_check <- rhub::get_check(previous_checks$group[1])
group_check

cran_prep <- check_for_cran()
cran_prep$cran_summary()

To check for URL validity and on Windows OS, use:

devtools::check_win_release()
devtools::check_win_devel()

Releasing to CRAN

To submit to CRAN call:

devtools::release()

and answer the prompted questions. If the answer to all of these is yes, the package will be submitted to CRAN :rocket:



phylotastic/datelife documentation built on June 9, 2024, 6:50 p.m.