This file contains 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
gistr |
This file contains 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
RDX3 | |
X | |
data.frame | |
This file contains 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: Example of combining `bind_rows()` with `map()` and `read_csv()` | |
output: github_document | |
--- | |
```{r} | |
library(tidyverse) | |
``` | |
If you have some data files with a similar structure: |
This file contains 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
license: MIT |
This file contains 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
<!DOCTYPE html> | |
<head> | |
<meta charset="utf-8"> | |
<script src="https://cdn.jsdelivr.net/npm/vega@4"></script> | |
<script src="https://cdn.jsdelivr.net/npm/vega-lite@3.0.0-rc1"></script> | |
<script src="https://cdn.jsdelivr.net/npm/vega-embed@3"></script> | |
</head> | |
<body> | |
<div id="vis"></div> |
This file contains 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(xml2) | |
url <- "http://www.aoml.noaa.gov/hrd/hurdat/hurdat2-nepac.html" | |
# Import ------------------------------------------------------------------ | |
hurricanes <- read_html(url) %>% | |
xml_find_first(".//pre") %>% | |
xml_text() %>% |
This file contains 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(xml2) | |
url <- "http://www.aoml.noaa.gov/hrd/hurdat/hurdat2-nepac.html" | |
# Column names ------------------------------------------------------------ | |
# From: http://www.aoml.noaa.gov/hrd/hurdat/newhurdat-format.pdf | |
# for the data lines | |
wind_vars <- cross_df(list( |
This file contains 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
1 | 2 | |
---|---|---|
3 | 4 |
This file contains 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(sp) | |
library(tmap) | |
library(tigris) | |
# devtools::install_github("cwickham/geospatial") | |
library(geospatial) | |
nyc_tracts <- tracts(state = "NY", county = "New York", cb = TRUE) | |
nyc_tracts_merge <- merge(nyc_tracts, nyc_income, by.x = "TRACTCE", by.y = "tract") | |
qtm(nyc_tracts_merge, fill = "estimate") |
This file contains 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
# edited from init_oauth2.0 to: | |
# * add trailing slash to callback | |
# * add base64 encoded client_id:client_secret to request when exchanging | |
init_oauth2.0_fitbit <- function(endpoint, app, scope = NULL, type = NULL, | |
use_oob = getOption("httr_oob_default"), | |
is_interactive = interactive()) { | |
if (!use_oob && !httr:::is_installed("httpuv")) { | |
message("httpuv not installed, defaulting to out-of-band authentication") | |
use_oob <- TRUE |
NewerOlder