Skip to content
This repository has been archived by the owner on Dec 30, 2020. It is now read-only.

jangorecki/dtq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dtq: data.table query Build Status

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

Installation

stopifnot(getRversion() >= "3.2.0")
install.packages("dtq", repos=c("https://jangorecki.gitlab.io/dtq", "https://cran.rstudio.com"))

Usage

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 packages
  • dtq.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.

License

GPL-3

About

data.table query

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages