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 |
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(Microsoft365R) | |
# site_url <- "fill in url" | |
site_files <- get_site_files( | |
site_url = site_url, | |
recurse = TRUE | |
) | |
files <- get_site_files(site_url) |
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
# title: R script for validating Baltimore city bike facility data, updating the | |
# schema to match new BMC standard, and adding new attributes for responsible | |
# agency and other characteristics | |
# | |
# author: Eli Pousson | |
# date: 2023-09-07 | |
# last-modified: 2023-09-09 | |
# Set up ---- |
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
#' Read an Excalidraw Markdown file created using the Obsidian Excalidraw | |
#' plugin. | |
#' | |
#' Plugin: https://github.com/zsviczian/obsidian-excalidraw-plugin | |
#' | |
#' This function uses the experimental yyjsonr package | |
#' <https://github.com/coolbutuseless/yyjsonr>. jsonlite would also work here. | |
#' | |
#' @param file A Markdown file created with the Obsidian Excalidraw plugin. | |
#' @param ... Additional parameters passed to [readr::read_lines()] |
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
table <- tidycensus::get_decennial( | |
geography = "block", | |
state = "MD", | |
county = "Baltimore city", | |
year = 2020, | |
table = "H1" | |
) | |
label_census <- function(data, | |
year = 2020, |