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(httr2) | |
library(semver) | |
library(glue) | |
get_compatible_ext <- function(namespace, name, code_version){ | |
url <- glue::glue("https://open-vsx.org/api/{namespace}/{name}/latest") | |
raw_ext_json <- httr2::request(url) %>% | |
req_headers(accept = "application/json") %>% req_perform() %>% resp_body_json() |
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
``` r | |
library(dplyr) | |
# vector operation | |
chunk_vec <- function(chunk_size){ | |
ceiling(seq_along(row_number())/chunk_size) | |
} | |
# operate on dataframe | |
chunk_df <- function(.data, chunk_size) { |
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(jsonlite) | |
library(shiny) | |
# get_json_data(date) | |
# score_letters(letters) | |
# read_keywords() on mac | |
# split_char(word) into words | |
# limit_words(words, str_length) to specific length and lower case | |
# top_words(word, words_in, top_n = 50) - combo of split_char, limit_words |
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(stringr) | |
library(jsonlite) | |
# create a function to solve the Keyword game | |
# this game uses a 6 letter horizontal word at the | |
# intersection of 6 other words, where a missing letter from each of the vertical words | |
# accounts for one letter of the mystery 6 letter length horizontal word | |
# how to play |
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(jsonlite) | |
library(shiny) | |
# get_json_data(date) | |
# score_letters(letters) | |
# read_keywords() on mac | |
# split_char(word) into words | |
# limit_words(words, str_length) to specific length and lower case | |
# top_words(word, words_in, top_n = 50) - combo of split_char, limit_words |
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
# Colab follows Google Drive style syntax | |
# so https://colab.research.google.com/drive/1R_G1BEdOSN6RcmNDZSG0vJtxk4rOodN7 | |
# means file id = 1R_G1BEdOSN6RcmNDZSG0vJtxk4rOodN7 | |
# so to download that file, we could use: | |
#> This would download the file and -O (output) as temp-quarto.ipynb | |
wget -O temp-quarto.ipynb 'https://docs.google.com/uc?export=download&id=1R_G1BEdOSN6RcmNDZSG0vJtxk4rOodN7' | |
# we can then pass that to quarto render | |
quarto render temp-quarto.ipynb --to html |
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
gt_render_reprex <- function(gt_object, imgur = FALSE) { | |
# create temp file | |
img_out <- tempfile(fileext = ".png") | |
# save image to temp | |
save_obj <- gt::gtsave(gt_object, img_out) %>% | |
utils::capture.output(type = "message") %>% | |
invisible() |
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
```{r write-tags} | |
#| echo: false | |
library(rvest) | |
library(xml2) | |
raw_html <- read_html(here::here("_site/index.html")) | |
length_tags <- raw_html |> | |
html_nodes("#quarto-margin-sidebar > div > 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
--- | |
format: html | |
--- | |
```{r} | |
library(ggplot2) | |
library(grid) | |
``` | |
```{r} |
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(dplyr) | |
raw_metrics <- espnscrapeR::get_espn_wr_metrics() | |
raw_metrics |> glimpse() | |
raw_metrics |> | |
group_by(gsis_id) |> | |
summarise(across(c(overall:rtm_targets, yds), mean), | |
across(ends_with("nm"), unique)) |> |
NewerOlder