Published: 2025-10-18
Author: Karo Zieminski
A growing library of repos, videos and skills for Claude Skills (100+)
| # pak::pak("r-lib/nanonext") | |
| library(nanonext) | |
| conns <- list() | |
| handlers <- list( | |
| handler_stream("/stream", | |
| on_request = function(conn, req) { | |
| conn$set_header("Content-Type", "application/x-ndjson") | |
| conns[[as.character(conn$id)]] <<- conn | |
| conn$send('{"status":"connected"}\n') |
Published: 2025-10-18
Author: Karo Zieminski
A growing library of repos, videos and skills for Claude Skills (100+)
| stopifnot(requireNamespace("rlang")) | |
| rlang::check_installed("pak") | |
| pkgs <- rlang::chr( | |
| "rlang" = "rlang", | |
| "plumber2" = "posit-dev/plumber2", | |
| "S7", | |
| "jsonlite", | |
| "httr2", | |
| "mirai", |
This document captures current best practices for R development, emphasizing modern tidyverse patterns, performance, and style. Last updated: August 2025
| # an example server: acquaint's MCP server for R sessions | |
| r_process <- callr::r_bg( | |
| function() acquaint::mcp_server(), | |
| stdout = "|", | |
| stdin = "|" | |
| ) | |
| Sys.sleep(1) | |
| log_cat_client <- function(x, append = TRUE) { |
| YAHOO_CLIENT_ID="" | |
| YAHOO_CLIENT_SECRET="" |
| <# | |
| %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
| %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
| %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
| %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
| %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@@@@@@@@@@@@@@@@@%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
| %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@#-:**************=*@%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
| %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%-%+=%%%%%%%%%%%%%%-#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
| %%%%%%%%%%%%%%%%%%##%%%%%%%%%%%%%%%%%%%%%%%:*%%=+%%%%%%%%%%%%%%.#@%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
| %%%%%%%%%%%%%%%%%%%#@%%%%%%%%%%%%%%%%%%@%%*#@%%@+%%%%%%%%%%%%%%%+%@%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| <# | |
| .SYNOPSIS | |
| Perform Git submodule update to any commit and/or branch. | |
| .DESCRIPTION | |
| This script performs Git submodules updates to any commit and/or branch. | |
| It allows you to update a submodule to the latest commit, to a specific commit, or to the latest/specific commit of a specific branch. | |
| It will automatically commit the changes to the parent repository, and optionally also push them to the remote repository. | |
| .PARAMETER pathToLocalRepo |
You are situated inside of an R package source directory. The subdirectory R/ contains source files. The subdirectory tests/testthat/ contains corresponding tests. e.g. R/task.R is tested primarily in tests/testthat/test-task.R.
Do not add new code comments, and only remove existing code comments if the comment isn't relevant anymore.
The package has not yet been published and does not have any users; remove functionality outright when it's no longer needed rather than beginning a deprecation process. No need to worry about breaking changes.
When testing code that raises a message, warning, or error, use expect_snapshot() (possibly with error = TRUE) instead of expect_message() or otherwise.
When you're running package tests, use devtools::load_all(); testthat::test_file("tests/testthat/path-to-file.R"). If you encounter namespacing issues, don't delete tests that otherwise should work, and instead ask me what to do.
| library(dplyr) | |
| api <- as_tibble(tools:::funAPI()) | |
| # list all header files from include dir | |
| header_files <- list.files( | |
| R.home("include"), | |
| full.names = TRUE, | |
| recursive = TRUE, |