View source: R/fn_map_gpsmart_output.R
fn_map_gpsmart_output | R Documentation |
Creates an interactive map showing shortlisted suspects' activity locations (nodes) within the user's set search radius of an input crime.
Use htmltools::save_html()
to save the output map as an html file.
fn_map_gpsmart_output(gpsmart_output, coordinate_system = 2193)
gpsmart_output |
A list with four elements, returned by running the function
|
coordinate_system |
CRS number for the coordinate system for the X and Y coordinates of the input crime and suspect node data. The default is New Zealand Transverse Mercator (2193). |
The function will return an error if there are no node predictions in gpsmart_output
to map.
Requires an internet connection.
An interactive map object that can be opened in the RStudio Viewer or an internet browser and saved as an html file for sharing. The map displays:
the location of the input crime (IC);
the activity nodes of all shortlisted suspects with nodes within the search_radius
when running fn_gpsmart()
, coloured by their predicted probability (as a percentile);
the search radius.
The user can:
pan and zoom to specific locations;
search (enter text or use drop-down menu) to filter nodes to a particular suspect(s) based on their identifier;
use a slider to limit the displayed nodes to those of the top x ranked suspects;
use tick boxes to limit the displayed nodes according to node_type
and other node attributes used in fn_gpsmart()
to calculate the predicted probability;
hover over a node to show the rank of the suspect;
click on a node to show a popup box with the suspect's rank and identifier, the node_type
, and the node's values on the GP-SMART variables;
search for an address or place name.
Sophie Curtis-Ham
fn_gpsmart()
creates the input object for this function.
## Not run: data(example_input_crime_raw) data(example_input_suspects_raw) gpsmart_output <- fn_gpsmart( input_crime = fn_prepare_input_crime(example_input_crime_raw), input_suspects = fn_prepare_suspect_data(example_input_suspects_raw), search_radius = 10, return_node_predictions = TRUE ) fn_map_gpsmart_output( gpsmart_output, coordinate_system = 2193 ) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.