load_samplingframe: Loads the sampling frame from a csv file, performing inital...

Description Usage Arguments Value See Also Examples

View source: R/util_load.R

Description

Loads the sampling frame from a csv file, performing inital tests on the data.

Usage

1
2
3
4
load_samplingframe(sampling.frame.file,
  sampling.frame.population.column = "population",
  sampling.frame.stratum.column = "stratum",
  data.stratum.column = "stratum", return.stratum.populations = FALSE)

Arguments

sampling.frame.file

name of a csv file containing the sampling frame

sampling.frame.population.column

sampling frame name of column holding population counts

sampling.frame.stratum.column

sampling frame name of column holding stratum names. Stratum names must match exactly values in:

data.stratum.column

data column name that holds the record's strata names

return.stratum.populations

by default this function returns 'NULL', but must be called to make automatic weighting in ..._weighted() functions possible. you can however retreive the stratum population counts by setting this to 'TRUE'.

Value

- makes function 'weights_of()' usable, and with it .._weighted() functions with automatic weighting 'NULL' if 'return.stratum.populations' is 'FALSE' (default) A named vector with the population counts per stratum, if 'return.stratum.populations' is set to 'TRUE'

See Also

load_data (not implemented), aggregate_count_weighted

Examples

1
load_data("mydata.csv",uuid.column="UUID")

mabafaba/reachR2 documentation built on May 3, 2019, 3:40 p.m.