Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

unitConversion

Convert Unit of Time Series Data


Description

Manipulate the units of time to different ones

Usage

unitConversion(x, from.unit, to.unit)

Arguments

x

A vector containing the values on x-axis.

from.unit

A string indicating the unit which the data is converted from.

to.unit

A string indicating the unit which the data is converted to.

Details

The supported units are "ns"(nanosecond), "ms"(millisecond), "sec", "min", "hour", "day", "month", and "year". Make sure from.unit and to.unit are not NULL before it is passed to this function.

Value

A list with the following structure:

x

Data

converted

A boolean indicating whether conversion is made

Examples

x = seq(60, 3600, 60)
unitConversion(x, 'sec', 'min')
y = 1:10
unitConversion(y, 'hour', 'sec')

simts

Time Series Analysis Tools

v0.1.1
AGPL-3 | file LICENSE
Authors
Stéphane Guerrier [aut, cre, cph], James Balamuta [aut, cph], Roberto Molinari [aut, cph], Justin Lee [aut], Yuming Zhang [aut], Wenchao Yang [ctb], Nathanael Claussen [ctb], Yunxiang Zhang [ctb], Christian Gunning [cph], Romain Francois [cph], Ross Ihaka [cph], R Core Team [cph]
Initial release
2019-07-21

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.