Open averissimo opened 8 months ago
Some parameters of module functions are not validated with checkmate:
checkmate
Here's a survey (that may not be complete):
pre_output
post_output
{teal.widgets}
tm_g_bivariate
facet
tm_g_distribution
plot_height
plot_width
tm_outliers
I propose we couple this with:
# Normalizing data types
# Start of assertions
# End of assertions
Example:
tm_g_foo <- function(label = "Regression Analysis", regressor, response, shape = shape_names, ggtheme = c("gray", "bw", "linedraw", "light", "dark", "minimal", "classic", "void")) { logger::log_info("Initializing tm_g_foo") # Normalize the parameters if (inherits(regressor, "data_extract_spec")) regressor <- list(regressor) if (inherits(response, "data_extract_spec")) response <- list(response) # Start of assertions checkmate::assert_string(label) checkmate::assert_list(regressor, types = "data_extract_spec") checkmate::assert_list(response, types = "data_extract_spec") if (!all(vapply(response, function(x) !(x$select$multiple), logical(1)))) { stop("'response' should not allow multiple selection") } checkmate::assert_character(shape) ggtheme <- match.arg(ggtheme) # End of assertions # ...
Some parameters of module functions are not validated with
checkmate
:Here's a survey (that may not be complete):
pre_output
,post_output
{teal.widgets}
functionstm_g_bivariate
:facet
tm_g_distribution
:plot_height
,plot_width
tm_outliers
:plot_height
,plot_width
I propose we couple this with:
# Normalizing data types
# Start of assertions
# End of assertions
Example: