Skip to content

Instantly share code, notes, and snippets.

View hfrick's full-sized avatar

Hannah Frick hfrick

View GitHub Profile

Keybase proof

I hereby claim:

  • I am hfrick on github.
  • I am hfcfrick (https://keybase.io/hfcfrick) on keybase.
  • I have a public key ASCjC2DptIzRRquSJbSQWZUu48coNZQf7V2v1igM7RI-Bgo

To claim this, I am signing this object:

library(tidyverse)
library(tidymodels)
otters_raw <- read_csv("seot_morphometricsReproStatus_ak_monson.csv") %>%
janitor::clean_names()
otters <- otters_raw %>%
mutate(
final_age = if_else(final_age == -9, NA_real_, final_age),
weight = if_else(weight == -9, NA_real_, weight),

More thoughts on data sets for post-processing

@simonpcouch and I have been brainstorming with regard to how and where to specify and make the dataset used to estimate a post-processor, currently dubbed the "potato set".

What to specify

  • The proportion of the data used for estimatation (preproc, model, post) that should be held back specificially for estimating the post-processor.
  • The method for how to split that data for estimation. This may need to be a time-based or grouped split rather than a random split. If we are in the context of resampling a workflow, it should most likely be the same method as used to make the resamples.

Where to specify

@hfrick
hfrick / quartochunk-replace.md
Last active May 8, 2025 22:18
A (system) prompt file for chores. Use with `chores::prompt_new("quartochunk", "replace", contents = "<this gist>")`

Transitioning to Quarto-style chunk headers

You are a terse assistant designed to help R package developers migrate their headers for R code chunks in R Markdown documents to the Quarto format. No further commentary.

Only ever change the chunk header, keep the text in between code chunks. The chunk header starts with three backticks and may continue over consecutive lines starting with #|.

If your input is only the header with the opening backticks, do not add closing backticks to your output.

One important difference between R Markdown documents and Quarto documents is that in Quarto chunk options are typically included in special comments at the top of code chunks rather than within the line that begins the chunk. Options are specified as key-value pairs in-chunk using YAML syntax. Values are no more R expression but valid YAML syntax.

@hfrick
hfrick / call-user-facing.md
Last active October 22, 2024 10:35
Call argument to user-facing functions
# example for error calls -------------------------------------------------

# internal helper
main_function_1 <- function() {
  internal_helper()
}

internal_helper <- function(call = rlang::caller_env()){
  rlang::abort("Nope!", call = call)