This file contains hidden or 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
| --- | |
| name: robot | |
| description: Operate a local multi-agent development workflow built on Kata (issue/work ledger), kwt (git worktrees + tmux workspaces), Roborev (optional, operator-approved AI code review), and AgentsView (agent session history). Use when choosing or claiming work, creating a worktree for an issue, recording progress or evidence, reviewing commits, closing or abandoning work, running experiments, handing off between agents, supervising parallel worker agents, recovering after a crash, or when the user mentions kata, kwt, roborev, agentsview, /robot, "ready work", "claim", "worktree", "review loop", or "close with evidence". | |
| --- | |
| # Robot: local agent development control plane | |
| Four tools by Wes McKinney / kenn.io, plus Git. There is no other database. Every piece of state comes from the system that owns it: | |
| | Question | Authority | Look at | |
This file contains hidden or 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
| #import "/.calepin/calepin.typ" as calepin | |
| #set document(title: [Dynamic tabs from R]) | |
| = Dynamic tabs from R | |
| The R function below accepts a named list and emits a | |
| `calepin.elements.tabs` call at the location of the code chunk. | |
| ```r |
This file contains hidden or 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
| --- | |
| title: "Converting rtables to tinytable" | |
| format: html | |
| --- | |
| ## Setup | |
| ```{r setup, message=FALSE, warning=FALSE} | |
| library(tinytable) | |
| library(rtables) |
This file contains hidden or 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
| Name: GNU General Public License | |
| Abbrev: GPL | |
| Version: 2 | |
| SSS: GPL-2 | |
| OSI: open (https://opensource.org/licenses/gpl-license) | |
| FSF: free (https://www.gnu.org/licenses/license-list.html#GPLv2) | |
| File: share/licenses/GPL-2 | |
| URL: https://www.r-project.org/Licenses/GPL-2 | |
| FOSS: yes | |
| SPDX: GPL-2.0-only |
This file contains hidden or 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
| lambda1 <- 1.8 | |
| lambda2 <- 0.7 | |
| x <- 0:10 | |
| p1 <- dpois(x,lambda1) | |
| p2 <- dpois(x,lambda2) | |
| dp <- data.frame(x=c(x,x),p=c(p1,p2),lambda=rep(c(lambda1,lambda2),each=length(x))) | |
| dp$lambda <- as.factor(dp$lambda) | |
| plt(p ~ x, | |
| facet = ~lambda, |
This file contains hidden or 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(marginaleffects) | |
| # sanity checks: let's be super strict | |
| sanity_vcov_unconditional <- function(p) { | |
| insight::check_if_installed("sandwich") | |
| cal <- attr(p, "call") | |
| callfun <- deparse(cal[[1]]) | |
| if (!identical(callfun, "predictions")) { | |
| msg <- "`vcov='unconditional'` is only supported for `avg_predictions()` calls." |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>tinytable_c80pijf8rq8f225cdrn6</title> | |
| <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet"> | |
| <script type="text/x-mathjax-config"> |
This file contains hidden or 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
| # Downloads data here: | |
| # https://academic.oup.com/ije/article/49/5/1719/5835351#226179197 | |
| ############################################################################# | |
| # TRIAL EMULATION: SURGERY WITHIN 6 MONTHS AMONG OLDER LUNG CANCER PATIENTS | |
| # Author: Clemence Leyrat (from Camille Maringe's Stata code) | |
| # Refactored by Vincent Arel-Bundock on 2023-12-08 |
This file contains hidden or 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
| # Example of examining a continuous x categorical interaction using emmeans, | |
| # and an attempt at doing the same using marginaleffects. | |
| # Author: Cameron Patrick <cameron.patrick@unimelb.edu.au> | |
| library(tidyverse) | |
| library(emmeans) | |
| library(marginaleffects) | |
| # use the mtcars data, set up am as a factor | |
| data(mtcars) |
This file contains hidden or 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(marginaleffects) | |
| library(modelsummary) | |
| set.seed(20220722) | |
| S <- diag(3) | |
| S[1,2] <- S[2,1] <- 0.6 | |
| S[1,3] <- S[3,1] <- 0.6 | |
| data <- MASS::mvrnorm(1000, rep(0, 3), S) |> | |
| as.data.frame() |> |
NewerOlder