knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(ApiPkgLab5)
This package access directly to reported County crime from API https://data.montgomerycountymd.gov/resource/icn6-v9z3.json.
Some features are selected to visualize output related to crime, like different type of crime, number of victims, district, city and so on.
This packages has two functions that are avaible for the users to get the dataframe of the crimes data.
The second function return the coordinates for the speicific given city.
# it take a limit parameter that can used also used for the big query like 200 obersvation. df <- get_crime_dataframe(300) head(df) head(get_city_crimes_loc("All Cities",df))
Also return the coordinates of all cities if empty string is specified.
There are methdos that are only developer used to fetch the data, valid the url , json keys methos. These methods reprent the backend logic of handling the server data.
# get_url() # get_key_names() # extend_base_url() # fetch_api_data()
This package also includes the shiny application to see the interactive visulization.
Shiny app uses the methods of the ApiPkgLab5 library for the retrival of data and also for filteratin coordinates of the different cities.
shiny::runGitHub("ApiPkgLab","zahrajalilpour292",subdir="inst/shiny-examples/", ref="main")
There is also another repository created for the shiny, In which explicitly we download the ApiPkgLab5 library and load it and use the data for the visulization.
shiny::runGitHub("shinyvisulization","arslan74", ref="main")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.