rsummary | R Documentation |
Compute per-column summaries and return as a data.frame
. Warning: can be an expensive operation.
rsummary(
db,
tableName,
...,
countUniqueNum = FALSE,
quartiles = FALSE,
cols = NULL,
qualifiers = NULL
)
db |
database connection. |
tableName |
name of table. |
... |
force additional arguments to be bound by name. |
countUniqueNum |
logical, if TRUE include unique non-NA counts for numeric cols. |
quartiles |
logical, if TRUE add Q1 (25%), median (50%), Q3 (75%) quartiles. |
cols |
if not NULL set of columns to restrict to. |
qualifiers |
optional named ordered vector of strings carrying additional db hierarchy terms, such as schema. |
For numeric columns includes NaN
in nna
count (as is typical for R
, e.g.,
is.na(NaN)
).
data.frame summary of columns.
if (requireNamespace("DBI", quietly = TRUE) &&
requireNamespace("RSQLite", quietly = TRUE)) {
d <- data.frame(p= c(TRUE, FALSE, NA),
s= NA,
w= 1:3,
x= c(NA,2,3),
y= factor(c(3,5,NA)),
z= c('a',NA,'a'),
stringsAsFactors=FALSE)
db <- DBI::dbConnect(RSQLite::SQLite(), ":memory:")
RSQLite::initExtension(db)
rq_copy_to(db, "dRemote", d,
overwrite = TRUE, temporary = TRUE)
print(rsummary(db, "dRemote"))
DBI::dbDisconnect(db)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.