dts_distribution | R Documentation |
Calculates distribution by DateTime.
dts_distribution(
x,
dtt = "DateTime",
colname = "Distribution",
units = "days",
normalize = TRUE,
.dts_fun = "dnorm",
.timing,
...
)
x |
A dts data frame |
dtt |
A string specifying the column with the Date or POSIXct values. |
colname |
A character vector specifying the column(s) with the other values. |
units |
A string of the time units for the variation (3rd and more) arguments of .dts_fun. |
normalize |
A flag indicating whether to normalize the values (ensure they sum to 1) or the proportion of the summed values to retain before renormalizing. |
.dts_fun |
A string of the name of a function which takes a numeric vector as its first argument (the values to calculate the distribution for), a numeric scalar as it second argument (the timing of the event) and one or more numeric scalars (representing the variation in the timing of the event). |
.timing |
A Date or POSIXct vector each element of which will be converted into a numeric value to be passed as the second argument to .dts_fun. |
... |
Additional arguments passed as named arguments to .dts_fun which should all be numeric vectors of the same length as .dtt or numeric scalars (which are reused). |
The date time values in x are converted into a numeric vector and passed as the first argument to .dts_fun.
The modified DateTime series data frame with a column of the distribution.
normalize
dts_distribution(dts_data[1:10,], .timing = dts_data$DateTime[2], sd = 2, units = "hours")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.