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

surveySmallValues(
  ds = NULL,
  questionsSurveySmallValues = NULL,
  enumeratorID = NULL,
  reportingColumns = c(enumeratorID, uniqueID),
  enumeratorCheck = FALSE
)

Arguments

ds

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

questionsSurveySmallValues

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 questionsSurveySmallValues <-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] <- surveySmallValues(ds=ds, questionsSurveySmallValues=questionsSurveySmallValues, enumeratorID=enumeratorID, reportingColumns=reportingColumns, enumeratorCheck=FALSE) head(ret_log,10) }
#> enumerator_id X_uuid values #> 1 52 4e05b9ee-2fb6-4276-ab73-7675e94f5011 4000 #> 2 10052 3c34b46b-96c4-46aa-9d4f-4147527f9042 15000 #> 3 10049 b404f0fa-d5ef-4fdf-a217-07509244c1f1 10000 #> 5 18 3e5ede43-369c-40f6-b59b-c73a5525a81d 7000 #> 6 83 225f1521-c75d-4a4e-b394-0f02ac8e9d8a 10000 #> 9 43 a98f85bc-0752-437d-a513-cc729804c303 25000 #> 11 91 13d4e232-ba59-4be6-84b4-f5e7d103f549 10000 #> 12 52 d18cc342-3e4f-46a2-8ed1-cf4c2bb73ab9 8000 #> 13 45 3f0d915b-7fa6-4262-8783-8d2c477af2e3 10000 #> 14 30022 93ea674d-29c4-4750-bb48-ce2125a55094 7000 #> ind #> 1 consent_received.food_security.spend_food #> 2 consent_received.food_security.spend_food #> 3 consent_received.food_security.spend_food #> 5 consent_received.food_security.spend_food #> 6 consent_received.food_security.spend_food #> 9 consent_received.food_security.spend_food #> 11 consent_received.food_security.spend_food #> 12 consent_received.food_security.spend_food #> 13 consent_received.food_security.spend_food #> 14 consent_received.food_security.spend_food