selectWeek: Select only agents with observations on each day of the week

Description Usage Arguments

Description

Removes agents which have weekdays without any observations. Optionally can be used to select agents which have observations on the specified days of the week (or weekdays/weekends only) and specify a minimum total number of observations required.

Usage

1
2
3
selectWeek(inputPath, weekdays = c("Sunday", "Monday", "Tuesday", "Wednesday",
  "Thursday", "Friday", "Saturday"), strictSelection = FALSE,
  minObsvsReq = NA, outputPath = inputPath, outputName = "WeekSel")

Arguments

inputPath

character; the path to the folder where the input *.csv files are located

weekdays

character vector (optional); the desired days of the week each agent should have measurements for (e.g. c("Sunday","Wednesday","Thursday") or alternatively use "midweek" (Tuesday to Thursday), "week" (Monday to Friday), "weekend" (Saturday and Sunday) or NA to skip this step altogether; default will require measurements on every day of the week (Monday to Sunday)

strictSelection

boolean; if TRUE will remove observations on other days than those specified, if FALSE (default) will select agents which have measurements on the days specified, but also maintain their observations on other days

minObsvsReq

numeric (optional); minimum required number of observations for each agent to be retained; default is NA (no minimum required)

outputPath

character (optional); the path to the folder to write the output csv files to, set to NA to not write output files; default is the inputPath

outputName

character (optional); if outputPath is not NA, will prefix the output filenames ("AgentID.csv") with this; default is "WeekSel", set to NA to just have the AgentIDs


eyesofbambi/TravelAIR documentation built on May 16, 2019, 9:56 a.m.