-
-
Notifications
You must be signed in to change notification settings - Fork 15
Closed
Labels
Description
Run app with normal data and an error is raised.
normal data
library(teal)
data <- teal_data()
data <- within(data, {
CO2 <- CO2
})
datanames(data) <- "CO2"
app
library(teal.modules.general)
library(teal.widgets)
vars <- choices_selected(variable_choices(data[["CO2"]], c("Plant", "Type", "Treatment")))
app <- init(
data = data,
modules = modules(
tm_outliers(
outlier_var = list(
data_extract_spec(
dataname = "CO2",
select = select_spec(
label = "Select variable:",
choices = variable_choices(data[["CO2"]], c("conc", "uptake")),
selected = "uptake",
multiple = FALSE,
fixed = FALSE
)
)
),
categorical_var = list(
data_extract_spec(
dataname = "CO2",
filter = filter_spec(
vars = vars,
choices = value_choices(data[["CO2"]], vars$selected),
selected = value_choices(data[["CO2"]], vars$selected),
multiple = TRUE
)
)
),
ggplot2_args = list(
ggplot2_args(
labs = list(subtitle = "Plot generated by Outliers Module")
)
)
)
)
)
runApp(app, launch.browser = TRUE)
error
Now run the app with data that has a primary key added:
data <- teal_data()
data <- within(data, {
CO2 <- CO2
CO2[["primary_key"]] <- seq_len(nrow(CO2))
})
datanames(data) <- "CO2"
join_keys(data) <- join_keys(join_key("CO2", "CO2", "primary_key"))
App works as intended.
Copilot