This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(getACS) | |
| library(tidyverse) | |
| vehicle_access_acs <- get_acs_tables( | |
| "tract", | |
| table = "B08201", | |
| county = "Baltimore city", | |
| state = "MD" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Get zoning metadata from {mapmaryland} | |
| baltimore_zoning_info <- dplyr::filter( | |
| mapmaryland::md_zoning_info, | |
| county == stringr::str_remove(map_params$county_name, ", Maryland$") | |
| ) | |
| # Create format function with custom colors ---- | |
| zoning_colors <- tibble::tribble( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Install packages if needed | |
| # install.packages(c("skimr", "spData", "tidyverse", "sf", "gt")) | |
| # Load packages | |
| library(spData) | |
| library(tidyverse) | |
| library(sf) | |
| library(gt) | |
| # Set a default ggplot2 theme |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This is a cleaned up version of your original function | |
| area_square_km <- function(data, ...) { | |
| data |> | |
| dplyr::mutate( | |
| dplyr::across( | |
| dplyr::all_of(...), | |
| ~ .x / 1000000 | |
| ) | |
| ) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(tidyverse) | |
| library(sf) | |
| c("A", "B", "C") | |
| "ABC" | |
| str_flatten(c("A", "B", "C")) | |
| us_states |> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| openapi: 3.0.0 | |
| info: | |
| title: SFTool API | |
| version: 1.0.0 | |
| description: | | |
| SFTool API provides machine readable data to develop a service or services to search, | |
| display, analyze, retrieve, and view SFTool data about healthy buildings and environmentally responsible purchasing. | |
| You can find out more about SFTool at [https://sftool.gov](https://sftool.gov). | |
| Use the api key 'DEMO_KEY' to test the SFTool API. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(sf) | |
| # You can read data from these URLs | |
| # GeoJSON (geojson) | |
| read_sf("https://github.com/ropensci/geojsonio/raw/main/inst/examples/california.geojson") | |
| # Keyhole Markup Language (kml) | |
| read_sf("https://github.com/ropensci/geojsonio/raw/main/inst/examples/poa_annua.kml") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(tidyverse) | |
| select(storms, name) | |
| select(storms, !name) | |
| select(storms, -name) | |
| select(storms, name:long) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # pak::pkg_install(c("elipousson/bcpss", "elipousson/mapbaltimore", "elipousson/maplayer", "hrbrthemes")) | |
| library(bcpss) | |
| library(tidyverse) | |
| library(sf) | |
| transportation_survey_resp <- parent_survey_SY1819 |> | |
| select( | |
| starts_with("school_n"), | |
| c("grade_band", "management_type", "parent_response_count"), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(sf) | |
| library(dplyr) | |
| # Can you convert `storms_sf` to make the feature geometry represent | |
| # storm tracks instead of storm observations? | |
| storms_sf <- storms |> | |
| st_as_sf( | |
| coords = c("long", "lat"), | |
| crs = 4326 |