nds_calc_speeding | R Documentation |
nds_calc_speeding
extracts the speeding rate from the
naturalistic data
nds_calc_speeding(data, type, by, spd, exp, percentage = FALSE)
data |
Object with naturalistic data (tibble or sf) |
type |
Character with the type of speeding results ("time" or "distance") |
by |
A column name to group the results |
spd |
Numeric value of the speeding threshold |
exp |
Numeric value of the exposure threshold |
percentage |
Boolean value establishing if thresholds are percentages (TRUE or FALSE) |
This function uses the naturalistic data as main
input and extracts the speeding rate , grouping the results by the
attributes of the desired variable (parameter by
). If type
is
set to "distance", data
must be a sf object with linestring geometry.
Otherwise, it can be a tibble or data.frame. spd
and exp
sets
two thresholds to identify exposure and speeding situations, based on the
performed speeds and speed limits. If percentage
is TRUE, these
thresholds are set as percentages of the speed limit.
A tibble with speeding rate results
path <- system.file("extdata", package = "ndsbr")
nds_data <- nds_load_data("driver", path)
nds_calc_speeding(nds_data, type = "time", by = ID, spd = 5, exp = 10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.