knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/"
)
options(width=100)
library(utsData)

Introduction

This package provides example datasets of univariate and multivariate unevenly spaced time series:

The data can be loaded, viewed, plotted, and analyzed using the uts, utsMultivariate, and utsTrendSeasonality (coming soon) R packages.

Installation

This package is not yet available on CRAN, but can be installled from GitHub, either using the R package devtools:

devtools::install_github("andreas50/uts", build_vignettes=TRUE)
devtools::install_github("andreas50/utsMultivariate")
devtools::install_github("andreas50/utsData")

or using the R package remotes:

remotes::install_github("andreas50/uts")
remotes::install_github("andreas50/utsMultivariate")
remotes::install_github("andreas50/utsData")

Sample Code

# Mauna Loa atmospheric CO2 concentration
par(mai=c(0.5, 0.5, 0.2, 0.2))
plot(co2_ml, cex.axis=0.8)
# Most consecutive observations are one month apart
table(round(diff(time(co2_ml)) / 365 * 12))
# Grape harvest dates (relative to August 31st) for Bordeaux region
# -) observations less than 2 years apart are connected by a line in the polot
par(mai=c(0.5, 0.5, 0.2, 0.2))
plot(grapes$Bordeaux, max_dt=dyears(2), type="o", cex=0.5, cex.axis=0.8)
# Same, but plot 20-year two-sided rolling average
if (requireNamespace("utsOperators", quietly=TRUE)) {
  plot(utsOperators::rolling_apply(grapes$Burgundy, width=dyears(20), FUN=mean, align="center"), cex.axis=0.8)
}


andreas50/utsData documentation built on May 13, 2019, 12:52 p.m.