clrdata {clr} | R Documentation |
Create an object of clrdata
Description
clrdata
is used to create a clrdata
object from raw data
inputs.
Usage
clrdata(x, order_by, support_grid)
Arguments
x |
A vector containing the time series values |
order_by |
A corresponding vector of unique time-dates - must be of class 'POSIXct' |
support_grid |
A vector corresponding to the support grid of functional data |
Value
An object of class clrdata
with one function a row. As it
inherits the matrix
class, all matrix
methods remain valid.
If time-dates are missing in x, corresponding NA functions are added by
clrdata
so that time sequence is preserved between successive rows.
Examples
library(clr)
data(gb_load)
clr_load <- clrdata(x = gb_load$ENGLAND_WALES_DEMAND,
order_by = gb_load$TIMESTAMP,
support_grid = 1:48)
head(clr_load)
dim(clr_load)
summary(clr_load)
matplot(t(clr_load), ylab = 'Daily loads', type = 'l')
lines(colMeans(clr_load, na.rm = TRUE),
col = 'black', lwd = 2)
clr_weather <- clrdata(x = gb_load$TEMPERATURE,
order_by = gb_load$TIMESTAMP,
support_grid = 1:48)
summary(clr_weather)
plot(1:48,
colMeans(clr_weather, na.rm = TRUE),
xlab = 'Instant', ylab = 'Mean of temperatures',
type = 'l', col = 'cornflowerblue')
[Package clr version 0.1.2 Index]