-
-
Notifications
You must be signed in to change notification settings - Fork 10
Remove yaml utils #391
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
Draft
averissimo
wants to merge
296
commits into
main
Choose a base branch
from
alternative@as_yaml@basename@teal_reportable
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Remove yaml utils #391
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…s shiny notifications @gogonzo comments
# Pull Request - Fixes #364 #### Changes description - On report download save images to folder - Uses cached HTML base64 images to save time _(avoids re-rendering)_
Signed-off-by: Marcin <[email protected]>
Co-authored-by: Pawel Rucki <[email protected]> Signed-off-by: Marcin <[email protected]>
Previously, this was the path that ended up in the Rmarkdown file <img width="966" height="913" alt="image (3)" src="https://github.com/user-attachments/assets/11c6d7b8-553e-4fe3-932a-7e4c5258ad11" /> that triggered inability to render the report for Windows ```r Quitting from report.Rmd:41-43 [unnamed-chunk-4] Render document error: Error in `gzfile()`: ! cannot open the connection ``` The root cause is `tempfile` in `.content_to_rmd` ```r sprintf("```{r echo = FALSE, eval = TRUE}\nreadRDS('%s')\n```", tempfile(pattern = "report_item_", fileext = ".rds", tmpdir = ".")) [1] "```{r echo = FALSE, eval = TRUE}\nreadRDS('.\\report_item_1c5031484b54.rds')\n```" tempfile(pattern = "report_item_", fileext = ".rds", tmpdir = ".") [1] ".\\report_item_1c503c7536c0.rds" ``` The solution is to take the `basename()` to curate the name of the file on windows ```r sprintf("```{r echo = FALSE, eval = TRUE}\nreadRDS('%s')\n```", basename(tempfile(pattern = "report_item_", fileext = ".rds", tmpdir = "."))) [1] "```{r echo = FALSE, eval = TRUE}\nreadRDS('report_item_1c50c277fb2.rds')\n```" ``` --------- Signed-off-by: Marcin <[email protected]> Co-authored-by: André Veríssimo <[email protected]>
Fix #357 Now it looks like this <img width="695" height="457" alt="image" src="https://github.com/user-attachments/assets/61917eac-dba7-4316-9cee-bad780a0ee16" /> Tested with ```r devtools::load_all('../teal.code') devtools::load_all('../teal.logger') devtools::load_all('../teal.data') devtools::load_all('../teal.reporter') devtools::load_all('../teal.widgets') devtools::load_all('../teal.transform') devtools::load_all('../teal') devtools::load_all('.') # ########################################## # # _ _ _ _ # | | | | | | | | # | |_ ___ __ _| | __| | __ _| |_ __ _ # | __/ _ \/ _` | | / _` |/ _` | __/ _` | # | || __/ (_| | || (_| | (_| | || (_| | # \__\___|\__,_|_| \__,_|\__,_|\__\__,_| # ______ # |______| # # teal_data # ######################################### data <- teal_data(join_keys = default_cdisc_join_keys[c("ADSL", "ADRS")]) data <- within(data, { require(nestcolor) ADSL <- rADSL ADRS <- rADRS }) # For tm_outliers fact_vars_adsl <- names(Filter(isTRUE, sapply(data[["ADSL"]], is.factor))) vars <- choices_selected(variable_choices(data[["ADSL"]], fact_vars_adsl)) # For tm_g_distribution vars1 <- choices_selected( variable_choices(data[["ADSL"]], c("ARM", "COUNTRY", "SEX")), selected = NULL ) init( data = data, modules = modules( # ################################################### # # _ # (_) # _ __ ___ __ _ _ __ ___ ___ ___ _ ___ _ __ # | '__/ _ \/ _` | '__/ _ \/ __/ __| |/ _ \| '_ \ # | | | __/ (_| | | | __/\__ \__ \ | (_) | | | | # |_| \___|\__, |_| \___||___/___/_|\___/|_| |_| # __/ | # |___/ # # regression # ################################################## tm_a_regression( label = "Regression", response = data_extract_spec( dataname = "ADSL", select = select_spec( label = "Select variable:", choices = "BMRKR1", selected = "BMRKR1", multiple = FALSE, fixed = TRUE ) ), regressor = data_extract_spec( dataname = "ADSL", select = select_spec( label = "Select variables:", choices = variable_choices(data[["ADSL"]], c("AGE", "SEX", "RACE")), selected = "AGE", multiple = TRUE, fixed = FALSE ) ) ) ) ) |> shiny::runApp() ``` --------- Signed-off-by: Marcin <[email protected]> Co-authored-by: André Veríssimo <[email protected]>
3 tasks
…_reportable Signed-off-by: André Veríssimo <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
WIP (this is a prototype as backwards compatibility may be improved):
yaml_utils.R#393Alternative for #389
Changes description
yaml_utils.Rfunctionstocoption