Create a report summarizing the results of data quality tests

bdc_create_report(
  data,
  database_id = "database_id",
  workflow_step,
  save_report = FALSE
)

Arguments

data

data.frame. Containing a unique identifier for each record and the results of data quality tests.

database_id

character string. The column name with a unique record identifier.Default = "database_id".

workflow_step

character string containing the following options("prefilter", "taxonomy", "space" or "time").

save_report

logical. Should the report be saved for further inspection? Default = FALSE.

Value

An HTML table widget (created with DT::datatable()) displaying the report summarizing the results of data quality assessment. It is shown when printed in RStudio or in an R Markdown document. When save_report = TRUE, the same report is also saved as a data frame in a CSV file in "Output/Report" (e.g. "01_Report_Prefilter.csv"), which can be read back with readr::read_csv().

Details

For "prefilter", "space" and "time", the report counts only the tests of that step (e.g., .rou and .urb for "space") and ignores test columns left by other steps, such as .uncer_terms from the taxonomy step. Its last row, "Summary of all tests", counts the records flagged by at least one test of that step. It can therefore be smaller than the number of records flagged in the .summary column created by bdc_summary_col(), which considers every column starting with ".".

Examples

if (FALSE) { # \dontrun{
database_id <- c("test_1", "test_2", "test_3", "test_4", "test_5")
.missing_names <- c(TRUE, TRUE, TRUE, FALSE, FALSE)
.missing_coordinates <- c(TRUE, FALSE, FALSE, TRUE, FALSE)
.basisOfRecords_notStandard <- c(TRUE, TRUE, FALSE, TRUE, TRUE)
.summary <- c(TRUE, FALSE, FALSE, FALSE, FALSE)

x <- data.frame(
  database_id,
  .missing_names,
  .missing_coordinates,
  .basisOfRecords_notStandard,
  .summary
)

report <-
  bdc_create_report(
    data = x,
    database_id = "database_id",
    workflow_step = "prefilter",
    save_report = FALSE
  )
} # }