bdclean (version 0.1.15)

clean_data: Data cleaning according to Questionnaire Responses.

Description

Use run_questionnaire to add Questionnaire Responses and pass it to this function to process the data faster.

Usage

clean_data(data, custom_questionnaire = NULL, clean = TRUE,
  missing = FALSE, report = TRUE, format = c("html_document",
  "pdf_document"))

Arguments

data

Biodiversity data in a data frame

custom_questionnaire

Custom user created questionnaire responses if to pypass answering questions each time.

clean

Whether to clean after flagging. If false only flagging will be done.

missing

How to treat data with missing values. Default: false - will be treated as bad data.

report

Whether to print report of cleaning done.

format

Formats of the cleaning report required. Options are: Markdown, HTML or / and PDF

Value

data frame with clean data

Details

Use create_default_questionnaire to create default questionnaire object. You can add your custom questions to this questionnaire and then pass it to this function to process the data.

Examples

Run this code
# NOT RUN {
custom_questionnaire <- create_default_questionnaire()

if(interactive()){

library(rgbif)
occdat <- occ_data(
  country = 'AU', # Country code for australia
  classKey = 359, # Class code for mammalia
  limit = 50 # Get only 50 records
)
myData <- occdat$data

responses <- run_questionnaire()
cleaned_data <- clean_data(myData, responses)

cleaned_data2 <- clean_data(myData)

} 

# }

Run the code above in your browser using DataLab