This function provide a report showing all values which are greater than a certain threshold for a specified list of fields.

surveyBigValues(
  ds = NULL,
  questionsSurveyBigValues = NULL,
  enumeratorID = NULL,
  reportingColumns = c(enumeratorID, uniqueID),
  enumeratorCheck = FALSE
)

Arguments

ds

dataset containing the survey (from kobo): data.frame

questionsSurveyBigValues

columns name from the dataset and value you want to check against (c(col1=value1,col2=value2,...)): named list of integer

enumeratorID

name of the field where the enumerator ID is stored: string

reportingColumns

(Optional, by default it is built from the enumeratorID and the UniqueID) name of the columns from the dataset you want in the result: list of string (c('col1','col2',...))

enumeratorCheck

(Optional, by default set to FALSE) specify if the report has to be displayed for each enumerator or not: boolean (TRUE/FALSE)

uniqueID

name of the field where the survey unique ID is stored: string

Value

dst same dataset as the inputed one but with survey marked for deletion if errors are found and delete=TRUE (or NULL)

ret_log list of the errors found (or NULL)

var a list of value (or NULL)

graph graphical representation of the results (or NULL)

Author

Yannick Pascaud

Examples

{ ds <- HighFrequencyChecks::sample_dataset questionsSurveyBigValues <-c(consent_received.food_security.spend_food=25000, consent_received.food_security.spend_medication=25000, consent_received.food_security.spend_education=25000, consent_received.food_security.spend_fix_shelter=25000, consent_received.food_security.spend_clothing=25000, consent_received.food_security.spend_hygiene=25000, consent_received.food_security.spend_fuel=25000, consent_received.food_security.spend_hh_items=25000, consent_received.food_security.spend_transport=25000, consent_received.food_security.spend_communication=25000, consent_received.food_security.spend_tobacco=25000, consent_received.food_security.spend_rent=25000, consent_received.food_security.spend_debts=25000, consent_received.food_security.spend_other=25000) enumeratorID <- "enumerator_id" uniqueID <- "X_uuid" reportingColumns <- c(enumeratorID, uniqueID) list[dst,ret_log,var,graph] <- surveyBigValues(ds=ds, questionsSurveyBigValues=questionsSurveyBigValues, enumeratorID=enumeratorID, reportingColumns=reportingColumns, enumeratorCheck=FALSE) head(ret_log,10) }
#> enumerator_id X_uuid values #> 9 43 a98f85bc-0752-437d-a513-cc729804c303 25000 #> 16 16 67324a24-765c-4ed7-bff0-5c739643b21b 25000 #> 57 65 7d6031c7-0dca-476b-89bc-2c5737f0e199 30000 #> 209 76 48a8986e-f3df-4507-9570-171c1499d123 40000 #> 220 45 a2656f4d-b3a6-4f2d-b580-2765aca98a37 30000 #> 271 71 cba3325e-d926-4d83-8fb2-ef8562c898d2 30000 #> 279 71 a0bfb570-21b0-4e8b-96a6-02d54ef28bff 30000 #> 280 30022 cad17139-8278-4542-ba27-270a31707f80 27000 #> 341 31 933e2ed6-c556-4a86-9b6d-5f84a1e538ca 30000 #> 396 45 7291bdc3-652c-414a-9f85-a77c998d0fbc 30000 #> ind #> 9 consent_received.food_security.spend_food #> 16 consent_received.food_security.spend_food #> 57 consent_received.food_security.spend_food #> 209 consent_received.food_security.spend_food #> 220 consent_received.food_security.spend_food #> 271 consent_received.food_security.spend_food #> 279 consent_received.food_security.spend_food #> 280 consent_received.food_security.spend_food #> 341 consent_received.food_security.spend_food #> 396 consent_received.food_security.spend_food