Computes the distances between the unique locations in the dataset and returns summary statistics.
Arguments
- data
an object of class
sfcontaining point geometries.- distance_crs
NULLto retain an existing projected CRS, or automatically reproject longitude/latitude data to the CRS frompropose_crs()(with a message naming the CRS and the units of distance). Alternatively, a CRS to reprojectdatato, which must itself be projected. A warning of classriskmap_warning_crsis raised when the CRS used distorts distances by more than 1% over the data.- distance_units
Character string, either
"km"or"m", indicating whether the distances used are expressed in kilometers or meters. Defaults to"km".- x
an object returned by
summarise_distance().- digits
the number of significant digits to print. Defaults to 3.
- ...
not used, and an error if given, so that a misspelt argument is not ignored.
Value
a named numeric vector of class RiskMap_distance_summary
containing the following components
minthe minimum distance
maxthe maximum distance
meanthe mean distance
medianthe median distance
The values are stored in full. Its print() method shows them to
digits significant digits, with the number of unique locations and the
distance units.
Examples
data(italy_sim)
summarise_distance(italy_sim)
#> ── Distances between locations ─────────────────────────────────────────────────
#> 200 unique locations, with distances in km.
#> min max mean median
#> 4.95 1,144 440 411
