Description Usage Arguments Value Examples
View source: R/suburbs_crime.R
HW2_function
suburbs_crime
The function take the user inputs and plot the correlation
in offence count between the two input suburbs from the data table
1 | suburbs_crime(crime_data, offence_description, suburbs)
|
crime_data |
A data.table object with the following columns: "date" (POSIXct), "suburb" (chr), "postcode" (chr), "offence_level_1" (chr), "offence_level_2" (chr), "offence_level_3" (chr), "offence_count" (num). |
offence_description |
A character string of offence level 3. |
suburbs |
A two-element character vector. Each element is the name (UPPERCASE) of an SA suburb. |
A ggplot object showing the correlation in offence count between the two input suburbs.
1 | suburbs_crime(datatable,"OFFENCES AGAINST PROPERTY", c("WEST BEACH", "ADELAIDE AIRPORT"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.