Learn R Programming

healthyR (version 0.1.4)

ts_ymwdh_tbl: Make a tibble with year, month, week, week day and hour information added

Description

Returns a tibble that has year, month, week, week day and hour added from a date column

Usage

ts_ymwdh_tbl(.data, .date_col)

Arguments

.data

The data that is being analyzed, data must be a tibble/data.frame

.date_col

The column of the tibble that holds the date

Value

A tibble

Details

  • Supply data with a date column and this will add the year, month, week, week day and hour to the tibble. The original date column is kept.

  • Returns a tibble.

  • You must know the data going into the function and if certain columns should be dropped or kept when using further functions

  • Future work - Add boolean for pad_by_time to fill in missing time series information

Examples

Run this code
# NOT RUN {
library(timetk)

ts_ymwdh_tbl(
  .data = m4_daily
  , .date_col = date
)

# }

Run the code above in your browser using DataLab