Last active
March 5, 2026 08:39
-
-
Save jrosell/19f61fe39442f321038c1440f1fac192 to your computer and use it in GitHub Desktop.
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
| # Reference: By Josh Goldstein from Dirk Eddelbuettel on https://mastodon.social/@eddelbuettel/116132645744985793 | |
| library(data.table) | |
| cw <- data.table(ChickWeight) | |
| # fmt: skip | |
| cw21 <- ( | |
| cw[Time %in% c(0, 21)] | |
| [, Weight := weight] | |
| [, Group := factor(paste0("Diet_", Diet))] | |
| [, .(Chick, Group, Time, Weight)] | |
| [order(Chick, Time)] | |
| [1:5] | |
| ) | |
| # Air formatter default | |
| cw21 <- (cw[Time %in% c(0, 21)][, Weight := weight][, | |
| Group := factor(paste0("Diet_", Diet)) | |
| ][, .(Chick, Group, Time, Weight)][order(Chick, Time)][1:5]) | |
| # Air formatter with air.toml with [format] skip = ["[", "]", "`[`", "`]`"] | |
| cw21 <- (cw[Time %in% c(0, 21)][, Weight := weight][, | |
| Group := factor(paste0("Diet_", Diet)) | |
| ][, .(Chick, Group, Time, Weight)][order(Chick, Time)][1:5]) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment