column_dt: Adding new date/time column(s)

Description Usage Arguments Value See Also Examples

View source: R/column_dt.R

Description

Creating a new column in a data set with a specified date or time rounding/conversion

Usage

1
column_dt(dataset, unit)

Arguments

dataset

The dataset for which to convert timezone data (column: "datetime")

unit

The unit(s) for which to apply to the dataset. Options: "date", "date_hour", "hour", "hour_minute", "time"

Value

Dataset with column(s) of newly specified time unit by row:

date

Column of the time stamp's date; class 'Date'.

date_hour

Column of the time stamp's date and time, rounded down by hour; class 'POSIXct','POSIXt'.

hour

Column of the time stamp's time, rounded down by hour; class 'hms', 'difftime'.

hour_minute

Column of the time stamp's time, rounded by minute; class 'hms', 'difftime'.

time

Column of the time stamp's time; class 'hms', 'difftime'.

See Also

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

Examples

1
2
column_dt(head(july_api_full)[1:3], c("date", "hour_minute"))
column_dt(head(july_api_hourly)[1:3], "hour")

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