rsummary_node | R Documentation |
This is a non_sql_node, so please see non_sql_node
for some of the issues for this node type.
rsummary_node(
source,
...,
quartiles = FALSE,
tmp_name_source = wrapr::mk_tmp_name_source("sn"),
temporary = TRUE
)
source |
incoming source (relop node or data.frame). |
... |
force later arguments to be by name |
quartiles |
logical, if TRUE add Q1 (25%), median (50%), Q3 (75%) quartiles. |
tmp_name_source |
wrapr::mk_tmp_name_source(), temporary name generator. |
temporary |
logical, if TRUE use temporary tables |
rsummary node
quantile_node
, non_sql_node
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)
ops <- db_td(db, "dRemote") %.>%
extend(., v %:=% ifelse(x>2, "x", "y")) %.>%
rsummary_node(.)
cat(format(ops))
print(to_sql(ops, db))
reshdl <- materialize(db, ops)
print(DBI::dbGetQuery(db, to_sql(reshdl, db)))
DBI::dbDisconnect(db)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.