Skip to content

Instantly share code, notes, and snippets.

View webbedfeet's full-sized avatar

Abhijit Dasgupta webbedfeet

View GitHub Profile
@webbedfeet
webbedfeet / name_chunks.py
Created October 2, 2024 21:56
Convert RMarkdown chunk labels to Quarto chunk labels, adding labels if they're not present
import re, os
regex = "```\{r (.+)\}"
def name_chunks(f):
"""
This function takes a quarto (.qmd) file, checks for rmarkdown-style
labels, and converts to quarto-style labels. If a quarto-style label
exists, it preserves it (it checks the first line of the chunk metadata).
If no label exists, it creates one based on the file name, in sequential order
@webbedfeet
webbedfeet / rstudio-prefs.json
Last active January 21, 2025 06:00
RStudio preferences
{
"save_workspace": "never",
"remove_history_duplicates": true,
"auto_detect_indentation": true,
"insert_native_pipe_operator": true,
"soft_wrap_r_files": true,
"continue_comments_on_newline": true,
"auto_append_newline": true,
"strip_trailing_whitespace": true,
"check_unexpected_assignment_in_function_call": true,
@webbedfeet
webbedfeet / r.snippets
Created January 21, 2025 01:06
RStudio R snippets
snippet lib
library(${1:package})
snippet req
require(${1:package})
snippet src
source("${1:file.R}")
snippet ret