This function imports seconds files output from the `ITS_to_seconds` function and bins them to specified minutes, starting from midnight.
For detailed explanation & illustration of options below, see https://htanderson.github.io/ITSbin/articles/bin_seconds-options.html
For more information, including example outputs and explanations of all output columns, see https://htanderson.github.io/ITSbin/
bin_seconds( seconds.dir, output.dir, bin.to.mins, cross.recordings = TRUE, align.rows = c("midnight", "recorder-on"), roll.by.mins = NULL, subset.by.col = NULL, drop.by.subset = NULL, overwrite.existing = FALSE )
seconds.dir | Directory (string) containing seconds CSV files. |
---|---|
output.dir | Directory (string) to store binned CSV files |
bin.to.mins | Character or numeric. Time interval to bin to (num MINS or "Total") |
cross.recordings | Logical. Should bins be calculated across or within recordings? (default = TRUE) |
align.rows | Character. opts = c("midnight", "recorder-on") Should the first bin start at midnight (00:00:00) the day the recorder was turned on ("midnight") or the first second in which the recorder was on ("recorder-on") |
roll.by.mins | Numeric. Default = NULL (sequential bins, eg 0-59, 60-119) How many minutes between bins (or, do bins overlap?). Ex, if bin.to.mins = 60 & roll.by.mins = 1, then 1st bin = minutes 0-59, 2nd bin = mins 1-60, 3rd = mins 2-61, etc. |
subset.by.col | Character. Include only rows where this column is NOT 0 (default = NULL). To include only seconds when the recorder was turned on, set subset.by.col = "recOn" & drop.by.subset = TRUE. |
drop.by.subset | Logical. If subset column is specified, should rows where subset.by.col == 0 be removed entirely (TRUE) or set to NA (FALSE)? To include only seconds when the recorder was turned on, set subset.by.col = "recOn" & drop.by.subset = TRUE. |
overwrite.existing | Logical. If the target file already exists, should the function overwrite it? If FALSE (default), subject will be skipped if file exists. If TRUE, new file will overwrite existing file. |
One CSV file per input seconds file.
if (FALSE) { bin_seconds( seconds.dir = "Server:/LENAData/secMidnight", output.dir = "Server:/LENAData/min1Midnight", bin.to.mins = 5, align.rows = "midnight") }