knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(nottshcMethods)
This create a dummy data for this experimentation
# Fix the randomness to ensure same data is generated every time set.seed(123) dummy_data <- data.frame( date = sample(seq(as.Date("2000/01/01"), by = "week", length.out = 10 * 12 * 4), size = 52 * 4 ) )
Using the dummy dataset created above, this finds the earliest and latest years in the dataset, useful for showing or referring to the date range in a dataset.
year_date(dummy_data, date, type = "earliest") year_date(dummy_data, date, type = "latest")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.