init_filtered_dataset {teal.slice} | R Documentation |
Initialize FilteredDataset
Description
Initializes a FilteredDataset
object corresponding to the class of the filtered dataset.
Usage
init_filtered_dataset(
dataset,
dataname,
keys = character(0),
parent_name = character(0),
parent = reactive(dataset),
join_keys = character(0),
label = attr(dataset, "label", exact = TRUE)
)
Arguments
dataset |
any object |
dataname |
( |
keys |
( |
parent_name |
( |
parent |
( |
join_keys |
( |
label |
( |
Value
Object of class FilteredDataset
.
Warning
This function is exported to allow other packages to extend teal.slice
but it is treated as internal.
Breaking changes may occur without warning.
We recommend consulting the package maintainer before using it.
Examples
# DataframeFilteredDataset example
library(shiny)
iris_fd <- init_filtered_dataset(iris, dataname = "iris")
ui <- fluidPage(
iris_fd$ui_add(id = "add"),
iris_fd$ui_active("dataset"),
verbatimTextOutput("call")
)
server <- function(input, output, session) {
iris_fd$srv_add(id = "add")
iris_fd$srv_active(id = "dataset")
output$call <- renderText({
paste(
vapply(iris_fd$get_call(), deparse1, character(1), collapse = "\n"),
collapse = "\n"
)
})
}
if (interactive()) {
shinyApp(ui, server)
}
if (requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
# MAEFilteredDataset example
library(shiny)
data(miniACC, package = "MultiAssayExperiment")
MAE_fd <- init_filtered_dataset(miniACC, "MAE")
ui <- fluidPage(
MAE_fd$ui_add(id = "add"),
MAE_fd$ui_active("dataset"),
verbatimTextOutput("call")
)
server <- function(input, output, session) {
MAE_fd$srv_add(id = "add")
MAE_fd$srv_active(id = "dataset")
output$call <- renderText({
paste(
vapply(MAE_fd$get_call(), deparse1, character(1), collapse = "\n"),
collapse = "\n"
)
})
}
if (interactive()) {
shinyApp(ui, server)
}
}