--- title: "Summaries and assignment" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{Summaries and assignment} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- `describe` applies `summary` to each variable and aligns statistics by name. It retains a data.frame for one variable; with `t = FALSE`, variables become rows. Missing statistics are NA. Columns convert to numeric where possible; heterogeneous statistics remain text. Date and POSIXt summaries retain calendar precision. `flextable = TRUE` requires flextable. `ft_args` customizes the table. Optional rendering is tested through structure and values rather than the printed text of a particular flextable version. The `%<...%` and `%...>%` operators assign objects. Use a list with `.envir` to select the destination and `.warn` to control the global-environment warning. If every requested name occurs in the values, assignment matches by name; otherwise it matches by position and requires equal lengths. Duplicate targets, locked or active bindings, and invalid lengths are detected before writing any object. For compatibility, plain target names without `.envir` select the global environment and warn. Examples use an explicit environment. The operators return NULL invisibly. ```{r} library(Dmisc) describe(data.frame(value = c(1, 2, NA), group = factor(c("A", "B", "A")))) output <- new.env(parent = emptyenv()) list("first", "second", .envir = output, .warn = FALSE) %<...% list(second = 20, first = 10) stopifnot(output$first == 10, output$second == 20) as.list(output) ```