View source: R/FilteredDataset-utils.R
init_filtered_dataset | R Documentation |
FilteredDataset
Initializes a FilteredDataset
object corresponding to the class of the filtered dataset.
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)
)
dataset |
any object |
dataname |
( |
keys |
( |
parent_name |
( |
parent |
( |
join_keys |
( |
label |
( |
Object of class FilteredDataset
.
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.
# 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)
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.