route_rolling_average | R Documentation |
This function calculates a simple rolling mean in base R. It is useful for calculating route characteristics such as mean distances of segments and changes in gradient.
route_rolling_average(x, n = 3)
x |
Numeric vector to smooth |
n |
The window size of the smoothing function. The default, 3, will take the mean of values before, after and including each value. |
Other route_funs:
route_average_gradient()
,
route_rolling_diff()
,
route_rolling_gradient()
,
route_sequential_dist()
,
route_slope_matrix()
,
route_slope_vector()
y <- od_data_routes$elevations[od_data_routes$route_number == 2]
y
route_rolling_average(y)
route_rolling_average(y, n = 1)
route_rolling_average(y, n = 2)
route_rolling_average(y, n = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.