Skip to content

Instantly share code, notes, and snippets.

View j-jayes's full-sized avatar

Jonathan Jayes j-jayes

View GitHub Profile
@j-jayes
j-jayes / structured-output-question.ipynb
Created March 7, 2025 10:39
Structured Output Question.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@j-jayes
j-jayes / geocoding_in_python.ipynb
Last active October 2, 2023 12:18
geocoding_in_python.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@j-jayes
j-jayes / generate_tabsets.Rmd
Created March 4, 2022 11:30
Programmatically generate tabs in Rmarkdown with xaringanExtra
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = F, message = F, warning = F)
```
## Purpose
I need to create a number of tabs in an Rmarkdown document, depending on the contents of the data queried.
In short, the Rmarkdown document must have a tab for each factor in a dataset, and draw a ggplot in the tab.
@j-jayes
j-jayes / leaflet_inputs.Rmd
Created November 6, 2021 19:31
Leaflet R click inputs
output$click_test <- renderPrint({reactiveValuesToList(input)})
# https://stackoverflow.com/questions/49885751/list-input-handlers-for-a-package-shiny-leaflet/49886501
# Super useful page on how to get the output of the clicks and hovers in leaflet
@j-jayes
j-jayes / knit-top-level.yaml
Created November 1, 2021 09:08
Modify YAML to knit from any subfolder to a top level for GitHub pages
knit: (function(input, ...) {
rmarkdown::render(
input,
output_file = paste0(
here::here(), '/index.html'
),
envir = globalenv()
)
})
@j-jayes
j-jayes / snake_to_sentence
Created September 6, 2021 09:17
Function for my personal package
## I should include a function in a personal package that takes snake case, as genrated by `janitor::clean_names()` and then makes it to sentence with spaces
### It would look like:
mutate(col = str_to_sentence(str_replace_all(col, "_", " ")))