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
| snippet seed | |
| set.seed(`r sample(0:999999, 1)`) |
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
| { | |
| "Set seed": { | |
| "prefix": "seed", | |
| "body": "set.seed($RANDOM)", | |
| "description": "Set the seed for random number generation" | |
| } | |
| } |
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
| gistr |
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
| RDX3 | |
| X | |
| data.frame | |
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: 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 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
| license: MIT |
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
| <!DOCTYPE html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <script src="https://cdn.jsdelivr.net/npm/vega@4"></script> | |
| <script src="https://cdn.jsdelivr.net/npm/[email protected]"></script> | |
| <script src="https://cdn.jsdelivr.net/npm/vega-embed@3"></script> | |
| </head> | |
| <body> | |
| <div id="vis"></div> |
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(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 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(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 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
| 1 | 2 | |
|---|---|---|
| 3 | 4 |
NewerOlder