categorize: Categorize recording data based on dates/times

Description Usage Arguments Value Examples

View source: R/categorize.R

Description

Categorize recording data based on dates/times

Usage

1
categorize(data, category.name, start.date, end.date, start.time, end.time)

Arguments

data

Selection data.frame.

category.name

String of what you want to call your category. Example: "Early Morning".

start.date

Start date for given category. Defaults to min date. Accepts multiple inputs including column name of a calculated field. Has to be numeric yday, string in "YYYY-MM-DD" format, Date format, or POSIXct.

end.date

End date for given category. Defaults to max date. Accepts multiple inputs including column name of a calculated field. Has to be numeric yday, string in "YYYY-MM-DD" format, Date format, or POSIXct.

start.time

Start time for a given category. Defaults to min time. Accepts multiple inputs including column name of a calculated field. Has to be a string in "hh:mm:ss" format, hms format, or POSIXct.

end.time

End time for a given category. Defaults to max time. Accepts multiple inputs including column name of a calculated field. Has to be a string in "hh:mm:ss" format, hms format, or POSIXct.

Value

A data.frame with a category column of defined categories.

Examples

1
data %>%  dplyr::group_by(location) %>% dplyr::mutate(category=NA) %>% categorize("EN","2017-16-01","2017-16-15","22:00:00","23:59:00")

deanrobertevans/TrillR documentation built on Dec. 19, 2021, 10:06 p.m.