Many data transformations are be provided by blocks constructed via
new_transform_block(), including examples where a single data.frame is
transformed into another (e.g. subset_block), and two or more data.frames
are combined (e.g. merge_block or rbind_block).
new_transform_block(server, ui, class, ctor = sys.parent(), ...)new_fixed_block(expr, ...)
new_head_block(n = 6L, direction = c("head", "tail"), ...)
new_merge_block(by = character(), all_x = FALSE, all_y = FALSE, ...)
new_rbind_block(...)
new_subset_block(subset = "", select = "", ...)
All blocks constructed via new_transform_block() inherit from
transform_block.
A function returning shiny::moduleServer()
A function with a single argument (ns) returning a shiny.tag
Block subclass
String-valued constructor name or function/frame number (mostly for internal use or when defining constructors for virtual classes)
Forwarded to new_transform_block() and new_block()
Quoted expression
Number of rows
Either "head" or "tail"
Column(s) tp join on
Join type, see base::merge()
Expressions (passed as strings)
Mainly useful for testing and examples, this block applies a fixed
transformation to its data input. No UI elements are exposed and the
transformation consequently cannot be parametrized. The quoted expression
passed as expr is expected to refer to the input data as data.
Row-subsetting the first or last n rows of a data.frame (as provided by
utils::head() and utils::tail()) is implemented as head_block. This is
an example of a block that takes a single data.frame as input and produces
a single data.frame as output.
Joining together two data.frames, based on a set of index columns, using
base::merge() is available as merge_block. Depending on values passed
as all_x/all_y the result will correspond to an "inner", "outer", "left"
or "right" join. See base::merge() for details. This block class serves
as an example for a transform block that takes exactly two data inputs x
and y to produce a single data.frame as output.
Row-wise concatenation of an arbitrary number of data.frames, as performed
by base::rbind() is available as an rbind_block. This mainly serves as
an example for a variadic block via the "special" ...args block data
argument.
This block allows to perform row and column subsetting on data.frame
objects via base::subset(). Using non-standard evaluation, strings passed
as subset/select arguments or entered via shiny UI are turned into
language objects by base::parse().