Skip to content

Conversation

@m7pr
Copy link
Contributor

@m7pr m7pr commented Jul 10, 2025

For join_keys included

Code
  devtools::load_all("teal.logger")
  devtools::load_all("teal.code")
  devtools::load_all("teal.data")
  devtools::load_all("teal.reporter")
  devtools::load_all("teal.transform")
  devtools::load_all("teal.widgets")
  devtools::load_all("teal")
  devtools::load_all("teal.modules.general")

  # general data example
data <- teal_data()
data <- within(data, {
  CO2 <- CO2
  CO2[["primary_key"]] <- seq_len(nrow(CO2))
})
join_keys(data) <- join_keys(join_key("CO2", "CO2", "primary_key"))
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
          )
        )
      )
    )
  )
)
if (interactive()) {
  shinyApp(app$ui, app$server)
}
image

Without join_keys in the preprocessing code

Code
  devtools::load_all("teal.logger")
  devtools::load_all("teal.code")
  devtools::load_all("teal.data")
  devtools::load_all("teal.reporter")
  devtools::load_all("teal.transform")
  devtools::load_all("teal.widgets")
  devtools::load_all("teal")
  devtools::load_all("teal.modules.general")

  # general data example
data <- teal_data()
data <- within(data, {
  CO2 <- CO2
  CO2[["primary_key"]] <- seq_len(nrow(CO2))
})
#join_keys(data) <- join_keys(join_key("CO2", "CO2", "primary_key"))
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
          )
        )
      )
    )
  )
)
if (interactive()) {
  shinyApp(app$ui, app$server)
}
image

Signed-off-by: Marcin <133694481+m7pr@users.noreply.github.com>
@m7pr m7pr requested a review from donyunardi July 10, 2025 07:41
@m7pr m7pr added the core label Jul 10, 2025
Signed-off-by: Marcin <133694481+m7pr@users.noreply.github.com>
@github-actions
Copy link
Contributor

github-actions bot commented Jul 10, 2025

Unit Tests Summary

  1 files  22 suites   1s ⏱️
144 tests 29 ✅ 115 💤 0 ❌
182 runs  67 ✅ 115 💤 0 ❌

Results for commit e419445.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 10, 2025

badge

Code Coverage Summary

Filename                      Stmts    Miss  Cover    Missing
--------------------------  -------  ------  -------  ---------------------------------------
R/tm_a_pca.R                    889     889  0.00%    139-1161
R/tm_a_regression.R             773     773  0.00%    178-1056
R/tm_data_table.R               201     201  0.00%    100-349
R/tm_file_viewer.R              172     172  0.00%    47-254
R/tm_front_page.R               144     133  7.64%    77-247
R/tm_g_association.R            344     344  0.00%    159-578
R/tm_g_bivariate.R              698     434  37.82%   331-826, 867, 978, 995, 1013, 1024-1046
R/tm_g_distribution.R          1123    1123  0.00%    156-1426
R/tm_g_response.R               369     369  0.00%    177-625
R/tm_g_scatterplot.R            734     734  0.00%    260-1098
R/tm_g_scatterplotmatrix.R      297     278  6.40%    198-532, 593, 607
R/tm_missing_data.R            1119    1119  0.00%    124-1420
R/tm_outliers.R                1061    1061  0.00%    163-1379
R/tm_t_crosstable.R             285     285  0.00%    175-509
R/tm_variable_browser.R         803     798  0.62%    89-1044, 1082-1265
R/utils.R                       151     135  10.60%   87-272, 302-338, 350-359, 364, 378-397
R/zzz.R                           2       2  0.00%    2-3
TOTAL                          9165    8850  3.44%

Diff against main

Filename           Stmts    Miss  Cover
---------------  -------  ------  --------
R/tm_outliers.R      +16     +16  +100.00%
TOTAL                +16     +16  -0.01%

Results for commit: e419445

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

m7pr and others added 2 commits July 10, 2025 13:27
Signed-off-by: Marcin <133694481+m7pr@users.noreply.github.com>
Copy link
Contributor

@donyunardi donyunardi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM.

@donyunardi donyunardi enabled auto-merge (squash) July 10, 2025 19:53
@donyunardi donyunardi merged commit 848f7ec into main Jul 10, 2025
25 checks passed
@donyunardi donyunardi deleted the 892_joinkeys_outliers@main branch July 10, 2025 20:00
@github-actions github-actions bot locked and limited conversation to collaborators Jul 10, 2025
@donyunardi donyunardi linked an issue Jul 11, 2025 that may be closed by this pull request
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tm_outliers fails if data has no joining keys

3 participants