View source: R/population_weighting.R
compute_ons_values | R Documentation |
This function takes a shapefile of points that can represent any services– for example, physicians, WIFI stations, or schools– and some standard ONS data inputs, and calculates five common ONS statistics:
compute_ons_values( point_shapefile, name_prefix = "", name_postfix = "", ons_shp = NA, ons_data, path_to_od_table, verbose = TRUE )
point_shapefile |
A shapefile of points representing service locations. |
name_prefix |
Optional - a prefix to be applied to column names. |
name_postfix |
Optional - a postfix (?) to be applied to column names. |
ons_shp |
Optional. An ONS shapefile. If not specified, uses internal data |
ons_data |
ONS data. Can be acquired using |
path_to_od_table |
File path to an OD table. |
verbose |
Boolean, defaults TRUE. Would you like many updates? |
Points per Neighbourhood
Points / 1000 residents in the neighbourhood plus a 50m buffer
Average travel distance to 3 nearest points
Average travel distance to 1 nearest point
% of residents within a 15-minute walk of any point
It needs as input a path to a long origin-destination (OD) table such as
can be generated using the Valhalla routing enging and valhallr::od_table()
.
A tbl_df with the calculated statistics.
## Not run: # file `wifi_walk_table.csv` computed previously using `valhallr::od_table()` ons_data <- onsr::get_ons_data() wifi_data <- onsr::compute_ons_values(point_shapefile = wifi_locations_nad, name_postfix = "wifi", ons_data = ons_data, path_to_od_table = "outputs/wifi_walk_table.csv") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.