Current version: 0.1.9.5
- log data.table query details
- call
- sequence
- environment
- timing
- in rows
- out rows
- source name
- control query logging environments
-
read.only
attribute for data.table -
dtq
class to store dtq call and metadata
stopifnot(getRversion() >= "3.2.0")
install.packages("dtq", repos=c("https://jangorecki.gitlab.io/dtq", "https://cran.rstudio.com"))
See vignette.
library(data.table)
library(dtq)
DT <- data.table(a = 1:10, b = letters[1:5])
LKP <- data.table(b = letters[1:5], ratio = rnorm(5), key = "b")
DT2 <- DT[, .(a = sum(a)), b
][a > median(a), .(b, a, adj_a = a * 1.1)]
LKP[DT2, .(b, a, adj2_a = adj_a * ratio)]
dtl()
Control logging by global options:
dtq.log.exclude
character, exclude queries from provided packagesdtq.log.include
character, log queries only from provided packages
Unless dtq.log.include
option is set the logging is active for all data.table queries excluding calls from data.table
and dtq
packages.
Otherwise only queries from provided packages will be logged, still excluding packages from dtq.log.exclude
option.
While using include option character R_GlobalEnv
can be provided to log also calls from global env.
GPL-3