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(ggplot2) | |
| library(ragg) | |
| library(systemfonts) | |
| library(tantastic) # tanho63/tantastic | |
| library(tidyverse) | |
| # Weepeople font https://github.com/propublica/weepeople/ | |
| colours <- c("#5E4AE3","#44FFD1","#EFCA08","#FF3366") | |
| crossing( |
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
| # All base R actually but make sure libcurl is installed if you're on Linux | |
| # Devtools -> Copy as cURL -> go to curlconverter.com/#r and paste -> mostly important to get headers in this case | |
| # idk which of these work but this combo works | |
| headers = c( | |
| `User-Agent` = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0', | |
| `Accept` = '*/*', | |
| `Accept-Language` = 'en-US,en;q=0.5', | |
| `Accept-Encoding` = 'gzip, deflate, br', | |
| `Origin` = 'https://www.mlb.com', | |
| `DNT` = '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
| library(yaml) | |
| url_tag <- "<a href='http://my-url.com'>My website</a>" | |
| attr(url_tag,"quoted") <- TRUE | |
| list(x = url_tag) |> yaml::as.yaml() | |
| # Gist URL https://gist.github.com/b8ba7b2c3a3578ac19737882fef7dbea |
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(yaml) | |
| url_tag <- "<a href='http://my-url.com'>My website</a>" | |
| attr(url_tag,"quoted") <- TRUE | |
| list(x = url_tag) |> yaml::as.yaml() | |
| # Gist URL https://gist.github.com/4d3ce5f22b53ebad6ed472653b700171 |
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(yaml) | |
| url_tag <- "<a href='http://my-url.com'>My website</a>" | |
| quoted <- function(x){ | |
| attr(x, "quoted") <- TRUE | |
| return(x) | |
| } | |
| list(x = quoted(url_tag)) |> yaml::as.yaml() | |
| # Gist URL https://gist.github.com/e194fa3e10d9e85fdedae6318e688557 |
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
| rb_opps <- data.table::rbindlist( | |
| list( | |
| nflreadr::load_ff_opportunity(stat_type = "pbp_rush"), | |
| nflreadr::load_ff_opportunity(stat_type = "pbp_pass") | |
| ), | |
| fill = TRUE) |> | |
| dplyr::filter(position == "RB" | receiver_position == "RB", week == 3, posteam == "MIA") |> | |
| dplyr::transmute( | |
| game_id, | |
| player_name = dplyr::coalesce(receiver_full_name, full_name), |
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
| base_label | map_label | is_modern | day_night | encounter_type | fishing_rod | species | encounter_rate | |
|---|---|---|---|---|---|---|---|---|
| gRoute101 | gRoute101 | FALSE | Day | land_mons | NA | Wurmple | 45 | |
| gRoute101 | gRoute101 | FALSE | Day | land_mons | NA | Poochyena | 45 | |
| gRoute101 | gRoute101 | FALSE | Day | land_mons | NA | Zigzagoon | 10 | |
| gRoute101_Night | gRoute101 | FALSE | Night | land_mons | NA | Wurmple | 65 | |
| gRoute101_Night | gRoute101 | FALSE | Night | land_mons | NA | Poochyena | 35 | |
| gRoute101_DayC | gRoute101 | TRUE | Day | land_mons | NA | Wurmple | 35 | |
| gRoute101_DayC | gRoute101 | TRUE | Day | land_mons | NA | Zigzagoon | 30 | |
| gRoute101_DayC | gRoute101 | TRUE | Day | land_mons | NA | Caterpie | 10 | |
| gRoute101_DayC | gRoute101 | TRUE | Day | land_mons | NA | Poochyena | 14 |
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(shiny) | |
| library(ggplot2) | |
| ui <- fluidPage( | |
| selectInput("var", choices = names(mtcars),label = "choose column"), | |
| br(), | |
| plotOutput("plot") | |
| ) | |
| server <- function(input, output, session) { | |
| output$plot <- renderPlot({ |
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
| ``` r | |
| print("pie") | |
| #> [1] "pie" | |
| ``` | |
| <sup>Created on 2025-09-19 with [reprex v2.1.1](https://reprex.tidyverse.org)</sup> |