createTimeSeries: create a regular time series

Description Usage Arguments Value Examples

View source: R/createTimeSeries.R

Description

This function will create a (empty) character time series. This can be used for creating regular time series of real-world observations that have missing data via merging.

Usage

1
createTimeSeries(start, end, step, type = c("POSIX", "char"))

Arguments

start

character string of starting date and time. Needs to be of format "YYYY-mm-dd HH:MM:SS"

end

character string of ending date and time. Needs to be of format "YYYY-mm-dd HH:MM:SS"

step

the time step of the time series (in seconds)

type

character. Determines whether to return an object of class 'POSIXct' (default) or 'character'.

Value

a character vector of datetimes spaced regularly from start to end

Examples

1
2
3
4
5
6
7
8
## 24 hrs
createTimeSeries("1990-01-01 00:00:00", "1990-01-01 23:00:00", step = 60 * 60)

## Not run: 
## 365 days
createTimeSeries("1990-01-01 00:00:00", "1990-12-31 23:00:00", step = 60 * 60 * 24)

## End(Not run)

environmentalinformatics-marburg/Rsenal documentation built on Sept. 23, 2018, 5:17 a.m.