Skip to content

bd-R/bdchecks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

3437abc Â· Oct 3, 2021
Oct 3, 2021
Mar 22, 2020
Dec 24, 2019
Jan 1, 2020
Dec 22, 2019
Sep 12, 2021
Sep 5, 2021
Sep 12, 2021
Oct 3, 2018
Dec 22, 2019
Sep 10, 2019
Feb 9, 2019
Mar 28, 2020
Sep 16, 2021
Sep 16, 2021

Repository files navigation

Travis CI Build Status AppVeyor Build Status Coverage Status
CRAN_Status_Badge CRAN_Download_Badge

bdchecks

Managing all data checks

Install bdchecks with:

install.packages("bdchecks")

Or for development version:

devtools::install_github("bd-R/bdchecks")

Load with:

library(bdchecks)

Performing data checks

Perform data checks (not exported yet):

result <- bdchecks::perform_dc(data_bats)

Check what data checks were performed (default show method):

result

Quick glance at data check result (% of records that passed) (not exported yet):

# Nice summary
summary_dc(result)

Dealing with new data checks

This is a recommended workflow to add new data checks:

  1. Load libraries
library(bdchecks)
library(devtools) # To install new version of a package
library(usethis) # To export data.checks object
  1. Check if original build works
check()
  1. Create new data check

3.1 Add meta information to ./inst/extdata/data_check.yaml file
3.2 Add data check function to ./R/ directory (file should be named after a data check, e.g. dc_checkthis.R). First argument to a data check function must be a vector (column) to perform data check on.
3.3 Add test data to ./inst/extdata/data_test.yaml

  1. Export new dat check
install() # To have new check in `system.file("extdata/data_check.yaml")`
data.checks <- bdchecks:::datacheck_info_export() # export documentation and combines new check with old ones
use_data(data_taxonrank, data.checks, data_bats, overwrite = TRUE, internal = TRUE) # exports old (and new data checks)
document() # document new check to `Rd`
install() # install package with a new check
  1. Test if everything works
perform_test_dc() # perform tests for data checks
check() # perform general check
  1. Post-incorporation

6.1 Increase version (and date) in DESCRIPTON
6.2 Run git add and git commit with message: "v0.x.x Added name_of_check data check"