# 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])