-
-
Notifications
You must be signed in to change notification settings - Fork 15
Replace table by plot on tm_missing_data #922
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
base: main
Are you sure you want to change the base?
Conversation
Code Coverage Summary
Diff against main
Results for commit: c296936 Minimum allowed coverage is ♻️ This comment has been updated with latest results |
Unit Tests Summary 1 files 23 suites 2s ⏱️ Results for commit c296936. ♻️ This comment has been updated with latest results. |
…g/teal.modules.general into 495_plot_missing@main
teal.reporter::teal_card("## Module's code") | ||
) | ||
teal.code::eval_code(obj, 'library("ggplot2");library("dplyr");library("tidyr")') # nolint: quotes | ||
teal.code::eval_code(obj, 'library("ggplot2");library("dplyr");library("tidyr")') # nolint: quotes_lintr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need the quotes for all of these :-)
teal.code::eval_code(obj, 'library("ggplot2");library("dplyr");library("tidyr")') # nolint: quotes_lintr | |
teal.code::eval_code(obj, "library(ggplot2);library(dplyr);library(tidyr)") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want to update all the library calls of modules on this package? I think in the past we changed this and then we had to revert it back.
R/tm_g_bivariate.R
Outdated
teal.code::eval_code( | ||
c( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Except here,
Can you break this into 2 eval_code
?
Why? When concatennating "character" with "expression" (as here) it transforms it in an expression and the code that's run is a "string", not the actual contents.
I detected this while testing something else.
My suggestion:
obj %>%
teal.code::eval_code("library(ggplot2);library(dplyr)") %>% # nolint: quotes)
teal.code::eval_code(
c(
as.expression(anl_merged_input()$expr)
)
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well spotted! I saw that the code generated was:
require(nestcolor)
CO2 <- data.frame(CO2)
stopifnot(rlang::hash(CO2) == "09a462eb86fab9a952e092bf6253c333") # @linksto CO2
.raw_data <- list2env(list(CO2 = CO2))
lockEnvironment(.raw_data) # @linksto .raw_data
"library(\"ggplot2\");library(\"dplyr\")"
ANL_1 <- CO2 %>% dplyr::select(conc, uptake, Type, Treatment)
ANL <- ANL_1
With this modification we get:
require(nestcolor)
CO2 <- data.frame(CO2)
stopifnot(rlang::hash(CO2) == "09a462eb86fab9a952e092bf6253c333") # @linksto CO2
.raw_data <- list2env(list(CO2 = CO2))
lockEnvironment(.raw_data) # @linksto .raw_data
library("ggplot2")
library("dplyr")
ANL_1 <- CO2 %>% dplyr::select(conc, uptake, Type, Treatment)
ANL <- ANL_1
#' argument in `teal.widgets::optionalSliderInputValMinMax`. | ||
#' | ||
# nolint start: line_length. | ||
# nolint start: line_length |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this puzzles me. But note that if you search for nolint
on the package there are some that end with a dot and some that don't. I also tried to create a reprex and I couldn't ...
Pull Request
Fixes #495
Replaces the table by a plot on "By Variables Levels" tab.
The colors match those in the other plots of the module.
It also required to add a "new" dependency, formatters, which is a dependency of tern, rlistings, rtable. I added it on Suggests.
There is an extra commit to update the lintr names