Learn R Programming

mads (version 0.1.6)

resample.data: Resamples the data for the bootstrap

Description

Can either resample samples within strata or observations within samples

Usage

resample.data(
  resample,
  obs.table,
  sample.table,
  ddf.dat.master,
  double.observer,
  subset.variable = "species"
)

Arguments

resample

if "samples" resample samples within strata, if "observations" resample observations within samples.

obs.table

dataframe of observation records with fields object, Region.Label, and Sample.Label which give links to sample.table, region.table and the data records used in model

sample.table

dataframe of sample records - Region.Label, Sample.Label, Effort

ddf.dat.master

list of complete/original datasets

double.observer

boolean indicating if it is a double observer survey

subset.variable

character describing which variable in the dataset should be used in subsetting the data.

Value

a list with 2 elements: ddf.dat.working a list of resampled datasets to be used in the analyses obs.table an updated obs.table with additional entries for data replicates

Details

Once the observations have been resampled duplicates are given a different object id and the obs.table is updated appropriately.