createTimeSeries: create a regular time series

View source: R/createTimeSeries.R

createTimeSeriesR Documentation

create a regular time series

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

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

## 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 July 28, 2023, 6:09 a.m.