-
-
Notifications
You must be signed in to change notification settings - Fork 15
{teal}
module returns a teal_report
object that extends from teal_data
#884
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
Open
averissimo
wants to merge
44
commits into
main
Choose a base branch
from
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.
Open
Changes from 9 commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
78d35c9
wip
gogonzo 38ee62e
Merge branch 'teal_data_report' into teal_reportable
gogonzo 9c498c1
WIP implementation of teal_reportable
gogonzo 334509b
no need to grid.draw grobs
gogonzo 61ab554
replace grob with grid output
gogonzo 2d091a5
Merge remote-tracking branch 'origin/main' into teal_reportable
gogonzo 8162a8c
[skip roxygen] [skip vbump] Roxygen Man Pages Auto Update
github-actions[bot] e734d5c
Naming (#885)
m7pr f0600dc
feat: improvements to tm_missing
averissimo ad5299c
feat: support argument rename and clean function body (#888)
averissimo c283343
fix srv_decorate_teal_data expression check
m7pr ba0e71e
rewrite modules to `teal_reportable` (#887)
m7pr 38eb4a5
use_evaluate WIP
gogonzo c8f488a
WIP on use_evaluate
gogonzo 719fdaa
Merge branch 'main' into use_evaluate
gogonzo 6ed5cbd
Merge branch 'use_evaluate' into teal_reportable
gogonzo 3db8aaa
[skip roxygen] [skip vbump] Roxygen Man Pages Auto Update
github-actions[bot] 1384b90
remotes
gogonzo 0ef73eb
[skip roxygen] [skip vbump] Roxygen Man Pages Auto Update
github-actions[bot] c0a2880
missing prefixes
m7pr d61561f
bring back sentence in tm_a_pca
m7pr 6773637
[skip roxygen] [skip vbump] Roxygen Man Pages Auto Update
github-actions[bot] 0f74447
add Module's code section header to divide code preparation with data…
m7pr 630204b
change moment where datatable is created for tm_missing_data
m7pr e3b5a0b
Update R/tm_outliers.R
m7pr fdd9f89
do not reshape data into DT in tm_outliers - only do that for printin…
m7pr 0f82001
Merge branch 'teal_reportable' of https://github.com/insightsengineer…
m7pr 9b324b0
make Module's code section with two ## - so it's h2 instead of h1
m7pr 83e41a5
Update R/tm_a_pca.R
averissimo 229def2
Update R/tm_a_pca.R
averissimo 6fc9beb
[skip style] [skip vbump] Restyle files
github-actions[bot] 6d86ebc
chore: fix long line
averissimo 508e3b2
[skip style] [skip vbump] Restyle files
github-actions[bot] 3f82dca
chore: remove linter rule
averissimo 45b9080
Merge branch 'main' into teal_reportable
m7pr 52b4d59
substitute append.teal_card with c.teal_card
m7pr 162b917
[skip style] [skip vbump] Restyle files
github-actions[bot] df02409
chore: lintr using quotes rule with double column and period at the end
averissimo 7c2dc13
[skip style] [skip vbump] Restyle files
github-actions[bot] 85f15de
Update R/tm_g_bivariate.R
m7pr 5ad53e9
Update R/tm_missing_data.R
m7pr 3bbf228
Update R/tm_t_crosstable.R
m7pr b64c3d7
missing assignment
m7pr 16c525b
Update R/tm_g_association.R
averissimo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -462,9 +462,11 @@ srv_a_regression <- function(id, | |
) | ||
}) | ||
|
||
qenv <- reactive( | ||
teal.code::eval_code(data(), 'library("ggplot2");library("dplyr")') # nolint quotes | ||
) | ||
qenv <- reactive({ | ||
obj <- data() | ||
teal.reporter::teal_card(obj) <- c(teal.reporter::teal_card(obj), "# Module's computation") | ||
teal.code::eval_code(obj, 'library("ggplot2");library("dplyr")') # nolint quotes | ||
}) | ||
|
||
anl_merged_q <- reactive({ | ||
req(anl_merged_input()) | ||
|
@@ -982,7 +984,7 @@ srv_a_regression <- function(id, | |
|
||
output_q <- reactive({ | ||
teal::validate_inputs(iv_r()) | ||
switch(input$plot_type, | ||
obj <- switch(input$plot_type, | ||
"Response vs Regressor" = output_plot_0(), | ||
"Residuals vs Fitted" = output_plot_1(), | ||
"Normal Q-Q" = output_plot_2(), | ||
|
@@ -991,21 +993,22 @@ srv_a_regression <- function(id, | |
"Residuals vs Leverage" = output_plot_5(), | ||
"Cook's dist vs Leverage" = output_plot_6() | ||
) | ||
obj | ||
}) | ||
|
||
decorated_output_q <- srv_decorate_teal_data( | ||
"decorator", | ||
data = output_q, | ||
decorators = select_decorators(decorators, "plot"), | ||
expr = print(plot) | ||
expr = quote(plot) | ||
) | ||
|
||
fitted <- reactive({ | ||
req(output_q()) | ||
req(decorated_output_q()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ❤️ good catch on both of these |
||
decorated_output_q()[["fit"]] | ||
}) | ||
plot_r <- reactive({ | ||
req(output_q()) | ||
req(decorated_output_q()) | ||
decorated_output_q()[["plot"]] | ||
}) | ||
|
||
|
@@ -1055,5 +1058,7 @@ srv_a_regression <- function(id, | |
teal.reporter::simple_reporter_srv("simple_reporter", reporter = reporter, card_fun = card_fun) | ||
} | ||
### | ||
|
||
decorated_output_q | ||
}) | ||
} |
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -265,7 +265,7 @@ srv_page_missing_data <- function(id, data, reporter, filter_panel_api, dataname | |
}) | ||
}) | ||
|
||
lapply( | ||
result <- sapply( | ||
datanames, | ||
function(x) { | ||
srv_missing_data( | ||
|
@@ -280,8 +280,18 @@ srv_page_missing_data <- function(id, data, reporter, filter_panel_api, dataname | |
ggplot2_args = ggplot2_args, | ||
decorators = decorators | ||
) | ||
} | ||
}, | ||
USE.NAMES = TRUE, | ||
simplify = FALSE | ||
) | ||
|
||
reactive({ | ||
if (is.null(input$dataname_tab)) { | ||
teal.data::teal_data() | ||
} else { | ||
result[[input$dataname_tab]]() | ||
} | ||
}) | ||
}) | ||
} | ||
|
||
|
@@ -521,7 +531,10 @@ srv_missing_data <- function(id, | |
|
||
group_var <- input$group_by_var | ||
anl <- data_r() | ||
qenv <- teal.code::eval_code(data(), { | ||
obj <- data() | ||
teal.reporter::teal_card(obj) <- c(teal.reporter::teal_card(obj), "# Module's computation") | ||
|
||
qenv <- teal.code::eval_code(obj, { | ||
'library("dplyr");library("ggplot2");library("tidyr");library("gridExtra")' # nolint quotes | ||
}) | ||
|
||
|
@@ -1269,34 +1282,36 @@ srv_missing_data <- function(id, | |
id = "dec_summary_plot", | ||
data = summary_plot_q, | ||
decorators = select_decorators(decorators, "summary_plot"), | ||
expr = { | ||
expr = quote({ | ||
grid::grid.newpage() | ||
grid::grid.draw(summary_plot) | ||
} | ||
summary_plot | ||
}) | ||
) | ||
|
||
decorated_combination_plot_q <- srv_decorate_teal_data( | ||
id = "dec_combination_plot", | ||
data = combination_plot_q, | ||
decorators = select_decorators(decorators, "combination_plot"), | ||
expr = { | ||
expr = quote({ | ||
grid::grid.newpage() | ||
grid::grid.draw(combination_plot) | ||
} | ||
combination_plot | ||
m7pr marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
}) | ||
) | ||
|
||
decorated_summary_table_q <- srv_decorate_teal_data( | ||
id = "dec_summary_table", | ||
data = summary_table_q, | ||
decorators = select_decorators(decorators, "table"), | ||
expr = table | ||
expr = quote(table) | ||
) | ||
|
||
decorated_by_subject_plot_q <- srv_decorate_teal_data( | ||
id = "dec_by_subject_plot", | ||
data = by_subject_plot_q, | ||
decorators = select_decorators(decorators, "by_subject_plot"), | ||
expr = print(by_subject_plot) | ||
expr = quote(by_subject_plot) | ||
) | ||
|
||
# Plots & tables reactives | ||
|
@@ -1417,5 +1432,7 @@ srv_missing_data <- function(id, | |
teal.reporter::simple_reporter_srv("simple_reporter", reporter = reporter, card_fun = card_fun) | ||
} | ||
### | ||
|
||
decorated_final_q | ||
}) | ||
} |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
Result will be the switch, why use
obj
?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.
Yeah, instead of
we can go with