redi | R Documentation |
Wrapper function that converts the dataset to the adequate format, compute
values of REDI for each Input
values, display a generic plot of the results
and return a tibble containing both data and corresponding REDI values.
redi(
data,
coef = c(0.05, 0.1, 0.5),
input = 1,
output = 2,
plot = TRUE,
by = "day",
format = "%Y%m%d",
summary_duplicate = mean
)
data |
A tibble or a data frame, containing an |
coef |
A number or vector, containing the values of the lambda coefficient used in the REDI computations, controlling the decay of the exponential weights. Default is c(0.05, 0.1, 0.5). |
input |
A character or a number, indicating the name or the
index of the |
output |
A character or a number, indicating the name or the
index of the |
plot |
A boolean, indicating whether results should be displayed. is TRUE. |
by |
A number or a character string, indicating the reference time period between two observations. Possible values are 'day', 'week', 'month', 'year', or any arbitrary number. See documentation of the 'seq()' for additional information if necessary. Default is 'day'. |
format |
A character string, indicating the date format of the input.
Please read |
summary_duplicate |
A function, used to summarise Output values for duplicated Input values. Default is mean. |
A tibble containing 4 columns : Input
(without duplicates),
Output
, Lambda
and REDI
, which corresponds to the vector
returned by the loop_REDI()
function.
data <- simu_db()
redi <- redi(data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.