Skip to contents

This function display the overall tracking sheet.

Usage

assessmentTrackingSheet(
  ds = NULL,
  dsSite = NULL,
  sampleSizeTable = NULL,
  sampleSizeTableSite = NULL,
  sampleSizeTableTarget = NULL,
  sampleSizeTableAvailable = NULL,
  surveyConsent = NULL,
  consentForValidSurvey = NULL
)

Arguments

ds

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

dsSite

name of the field in the dataset where the site is stored: string

sampleSizeTable

dataset containing the sampling frame: data.frame

sampleSizeTableSite

name of the field in the sampling frame where the site is stored: string

sampleSizeTableTarget

name of the field where the target number of survey is stored in the sampling frame: string

sampleSizeTableAvailable

name of the field where the number of points generated is stored in the sampling frame: string

surveyConsent

name of the field in the dataset where the survey consent is stored: string

consentForValidSurvey

value defined in the kobo form to acknowledge the surveyed person gave his consent: string

checkperiod

if not null number of day before today when the check should be made

Value

result a list that includes: * 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)

Examples

load(system.file("sample_dataset.RData", package = "HighFrequencyChecks"))
ds <- sample_dataset
dsSite <- "union_name"
load(system.file("SampleSize.RData", package = "HighFrequencyChecks"))
sampleSizeTable <- SampleSize

sampleSizeTableSite <- "Union"
sampleSizeTableTarget <- "SS"
sampleSizeTableAvailable <- "TotPts"                # Usually the Target + a buffer
surveyConsent <- "survey_consent"
consentForValidSurvey <- "yes"                      # consent value for yes

result <- assessmentTrackingSheet(ds = ds,
                                  dsSite = dsSite,
                                  sampleSizeTable = sampleSizeTable,
                                  sampleSizeTableSite = sampleSizeTableSite,
                                  sampleSizeTableTarget = sampleSizeTableTarget,
                                  sampleSizeTableAvailable = sampleSizeTableAvailable,
                                  surveyConsent = surveyConsent,
                                  consentForValidSurvey = consentForValidSurvey)

knitr::kable(head(result[["ret_log"]], 10))  
#> 
#> 
#> |Site              | Target| PointsAvailable| ValidSurveys| TotalSurveyDone| ToDo| RemainingPoints|
#> |:-----------------|------:|---------------:|------------:|---------------:|----:|---------------:|
#> |baharchhara       |    253|             317|           12|              19|  241|             298|
#> |haldia palong     |    260|             325|           21|              27|  239|             298|
#> |jalia palong      |    259|             324|           13|              19|  246|             305|
#> |nhilla            |    259|             324|           42|              54|  217|             270|
#> |palong khali      |    255|             319|           72|             115|  183|             204|
#> |raja palong       |    261|             327|           29|              37|  232|             290|
#> |ratna palong      |    252|             315|           19|              31|  233|             284|
#> |sabrang           |    260|             325|           11|              20|  249|             305|
#> |teknaf            |    259|             324|           41|              74|  218|             250|
#> |teknaf paurashava |    253|             317|            3|               4|  250|             313|
print(result[["graph"]])