knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "README-"
)

pkgload::load_all()

hms

Lifecycle: maturing Travis-CI Build Status AppVeyor Build Status codecov CRAN_Status_Badge

Overview

The hms package provides a simple class for storing durations or time-of-day values and displaying them in the hh:mm:ss format. This class is intended to simplify data exchange with databases, spreadsheets, and other data sources:

Installation

# The easiest way to get hms is to install the whole tidyverse:
install.packages("tidyverse")

# Alternatively, install just hms:
install.packages("hms")

# Or the the development version from GitHub:
# install.packages("devtools")
devtools::install_github("tidyverse/hms")

Usage

The following example showcases ways of using the hms class standalone or as a data frame column.

library(hms)

hms(56, 34, 12)
as_hms(1)
as_hms("12:34:56")
as_hms(Sys.time())
as.POSIXct(hms(1))

data.frame(hours = 1:3, hms = hms(hours = 1:3))

Please note that the 'hms' project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.



krlmlr/hms documentation built on Jan. 3, 2020, 7:20 a.m.