View source: R/GenerateRegularDailyTS.R
GenerateRegularDailyTS | R Documentation |
Generates a regular time series with daily resolution out of an daily but irregular time series.
GenerateRegularDailyTS(TimeChar, Datavec, na.rm = TRUE, format = '%Y-%m-%d',
tz = 'UTC',option = 'stine',Header=c('Time','Data'), Start,End, PlotIt = FALSE,
AggregateFun=sum,...)
TimeChar |
[1:n] Time in character or date format |
Datavec |
[1:n] numerical data vector |
na.rm |
Either |
format |
if not default, then check |
tz |
sometimes durations and time difference cannot be calculated if timezone is not chosen, default: 'UTC' |
option |
in case of |
Header |
Optional, Default is |
Start |
Optional, |
End |
Optional, |
PlotIt |
TRUE: plotting, FALSE: no plots |
AggregateFun |
Optional, in the special case that there are several values in |
... |
in the case that |
Regular spaced time series with missing values filled depending on na.rm
choice. The choices are
ff
- ForwardFill: The first value before a NaN
defines all NaN
until the next value is available
bf
- BackwardFill: The last value after a NaN
defines all NaN
before that value
zero
: NaN
are replaced with zeros
mean
/min
/max
: NaN
are replaced with the average/minimum/maximum of Datavec
weighted_ff
/weighted_bf
: The either weighted ForwardFill or BackwardFill. weighted means that the relevant value is normalized by the number NaN
before or after and this value replaces the given value and all relevant NaN
Regular TS of equidistance as a tibble data frame
Michael Thrun
GenerateRegularNonDailyTS
##tobefilled
## Not run:
#take the last value of a day
V=GenerateRegularDailyTS(Time,Price,Header = c("UTC_Time","Price"),na.rm = "ff",AggregateFun = tail,n=1)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.