- Runs specific code for test cases.
testthat
andRUnit
packagesusethis::use_testthat()
context("All my data tests") test_that("Data is installed", { expect_is(sri24_image_df(), "data.frame") })
- see
expect_equal
,expect_identical
, etc.
testthat
and RUnit
packagesusethis::use_testthat()
context("All my data tests") test_that("Data is installed", { expect_is(sri24_image_df(), "data.frame") })
expect_equal
, expect_identical
, etc.covr
packagecovr::package_coverage()
- defaults to tests unit tests onlycovr::package_coverage(type = "all")
- runs tests, vignettes, examples.covr
packageOnline services that allow you to view the coverage online:
--as-cran
in Check Package
area.devtools::check(args = c('--as-cran'))
devtools::check(args = c('--as-cran'))
Before submitting to CRAN:
available::available("PACKAGE_NAME")
: checks package namenotes
: non-global visible things are a by-product of tidyverse
non-standard evaluationR
, runs R CMD check --as-cran
, and provides result   
Check the package for stability
usethis::use_travis()
- creates .travis.yml
warnings_are_errors: true
Add coverage: usethis::use_coverage()
- pick coveralls
/codecov
:
after_success: - Rscript -e 'covr::coveralls(type = "all")' - Rscript -e 'covr::codecov(type = "all")'
usethis::use_appveyor()
- creates appveyor.yml
CRAN policy (long): https://cran.r-project.org/web/packages/policies.html
devtools::release()
(needs NEWS.md
and cran-comments.md
)
.tar.gz
, upload to https://cran.r-project.org/submit.htmlhttps://neuroconductor.org/submit-package
man
folderNAMESPACE
with blank file with # Generated by roxygen2: do not edit by hand
at the topImports
/Suggests
/Depends
Imports
. Only in very rare cases, use Depends
, unless depending on R
version.@importFrom
directives instead of @import