-
-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider migration to dm
#8
Comments
Instead of replacing what we currently have with |
@kpagacz Do you think about having |
Having dm in the filter panel could be a obstacle to have independent datasets reactivity. library(shiny)
library(dm)
library(scda)
ADSL <- synthetic_cdisc_data("latest")$adsl
ADTTE <- synthetic_cdisc_data("latest")$adtte
ADRS <- synthetic_cdisc_data("latest")$adrs
IRIS <- iris
IRIS$id <- seq_len(nrow(IRIS))
dm <- dm(ADSL, ADTTE, ADRS, IRIS) |>
dm_add_pk(ADSL, teal.data::get_cdisc_keys("ADSL")) |>
dm_add_pk(ADTTE, teal.data::get_cdisc_keys("ADTTE")) |>
dm_add_pk(ADRS, teal.data::get_cdisc_keys("ADRS")) |>
dm_add_pk(IRIS, "id") |>
dm_add_fk(table = ADTTE, columns = teal.data::get_cdisc_keys("ADSL"), ref_table = ADSL) |>
dm_add_fk(table = ADRS, columns = teal.data::get_cdisc_keys("ADSL"), ref_table = ADSL)
shinyApp(
ui = fluidPage(
sidebarPanel(
selectInput("Species", "Select species", choices = unique(iris$Species), selected = "Setosa"),
verbatimTextOutput("ADSL_rows"),
verbatimTextOutput("iris_rows")
)
),
server = function(input, output, session) {
filtered_data <- eventReactive(input$Species, {
dm_filter(dm, IRIS, Species %in% input$Species)
})
filtered_adsl <- reactive(filtered_data()[["ADSL"]])
filtered_iris <- reactive(filtered_data()[["IRIS"]])
output$ADSL_rows <- renderText({
print("ADSL triggered")
Sys.sleep(2)
nrow(filtered_adsl())
})
output$iris_rows <- renderText({
print("IRIS triggered")
Sys.sleep(2)
nrow(filtered_iris())
})
}
) |
I have an opinion that
|
Blocked by insightsengineering/teal#628 - we need more insights about how chevron and teal fits together.
dm
object to manage relationships between data.frames object.dm
be primary data object passed to the teal_module?Some initial research
dm
throws an error if the primary keys are duplicateddm
holds data in list, so the data is copied by referencedm_filter
dm
dm
object is mutabledm
operations preserve attributesIssues:
dm
renames duplicated the columns automatically so we might have a problem with difference between input column names and output column names.input$select_from_adsl
andinput$select_from_adrs
won't be found incolnames(data)
won't support same dataset selectors by default. Following will not possibleNot needed since we are going to fix data_merge Design data extract and data merge NEST-roadmap#36
Maybe we should reconsider this problematic option and just to do this:
The text was updated successfully, but these errors were encountered: