apply_hour_tags: Create a column of "Date Tags"

Description Usage Arguments Value See Also Examples

View source: R/apply_hour_tags.R

Description

Create a column of date tags based on specified hour ranges (created using inputted starts) and respective names (tags).

Usage

1
apply_hour_tags(dataset, starts = input_hour_starts, tags = input_hour_tags)

Arguments

dataset

The dataset for which to apply the date tags to.

starts

Numeric list of start hours (in 24 hour format)

tags

Character list of tags

Value

Dataframe with a new column ("hour_tag") containing the appropriate hour tag with respect to each row's timestamp.

See Also

Other miscellaneous functions: adjust_timezone(), ambient_temperature(), apply_date_tags(), column_dt(), filter_df(), group_stad(), organize_stad(), rounding_w_zeroes(), unit_convert(), wrangle_meta()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
apply_hour_tags(
  july_frm_diurnal[1:3],
  c(5, 12, 17, 21),
  c("Morning", "Afternoon", "Evening", "Night")
)
apply_hour_tags(
  july_frm_diurnal[1:3],
  starts = c(6, 22),
  tags = c("Awake", "Asleep")
)

gmcginnis/AirVizR documentation built on Dec. 20, 2021, 11:49 a.m.