Skip to contents

Read sampling parameters for Primary Sampling Units in multi-stage sampling.

Usage

ReadPSUSamplingParameters(FileName)

Arguments

FileName

path to sampling parameters

Details

Reads sampling parameters from a tab delimited file with headers corresponding to those listed in PSUSamplingParametersData. The file format provide the data as one table, so that the information in 'sampleTable' is repeated for each entry in 'selectionTable'. Any columns not named in PSUSamplingParametersData are assumed to be stratification variables. The conditions listed for the variables in PSUSamplingParametersData are checked upon reading the data, and execution halts with error if any are violated. Consult the examples in this documentation to see how the resource is formatted with a stratification variable 'Species'.

Examples

 # embedded example file:
 exampleFile <- system.file("testresources", 
                        "lotteryParameters", 
                        "lotteryDesignNSHstrata.txt", package="RstoxFDA")
 
 # Read example file with StoX
 PSUSamplingParametersData <- RstoxFDA::ReadPSUSamplingParameters( 
                          FileName=exampleFile)
 
 # Read example file as flat table, to illustrate formatting
 FlatSamplingParametersData <- read.csv(exampleFile, sep="\t")