From 67d2eb39e8ee7061ad6593973fd4c49cbf3ac39c Mon Sep 17 00:00:00 2001 From: Zheng Ren Date: Wed, 15 Jan 2025 21:01:40 -0500 Subject: [PATCH] edit example code --- R/Help_Func.R | 83 +++++++++++++++++++++++------------ R/age_shiny.R | 84 ++++++++++++++++++++++++++---------- R/comfam_shiny.R | 40 +++++++++++++---- man/age_save.Rd | 20 +++++++-- man/age_shiny.Rd | 4 +- man/age_table_gen.Rd | 18 +++++--- man/age_trend_plot.Rd | 31 ++++++++----- man/combat_plot_gen.Rd | 17 ++++++-- man/combat_table_gen.Rd | 19 ++++++-- man/comfam_shiny.Rd | 4 +- man/cus_result_gen.Rd | 15 ++++++- man/customize_percentile.Rd | 15 ++++++- man/diag_save.Rd | 19 ++++++-- man/form_gen.Rd | 2 +- man/getQuantileRefactored.Rd | 31 +++++++------ man/interaction_gen.Rd | 3 +- 16 files changed, 291 insertions(+), 114 deletions(-) diff --git a/R/Help_Func.R b/R/Help_Func.R index 2f56bca..9041828 100644 --- a/R/Help_Func.R +++ b/R/Help_Func.R @@ -509,7 +509,7 @@ model_gen <- function(y, type = "lm", batch = NULL, covariates = NULL, interacti #' @export #' #' @examples -#' covariates = adni[, c("AGE", "SEX")] +#' covariates <- adni[, c("AGE", "SEX")] #' form_gen(x = "lm", c = covariates) #' @@ -560,13 +560,12 @@ form_gen <- function(x, c = NULL, i = NULL, random = NULL, smooth = NULL){ #' @export #' #' @examples -#' \dontrun{ #' interaction_gen(type = "lm", covariates = c("AGE", "SEX", "DIAGNOSIS"), #' interaction = "AGE,DIAGNOSIS") #' #' interaction_gen(type = "gam", covariates = c("AGE", "SEX", "DIAGNOSIS"), #' smooth = "AGE", smooth_int_type = "linear", interaction = "AGE,DIAGNOSIS") -#' } +#' @@ -645,12 +644,22 @@ interaction_gen <- function(type = "lm", covariates = NULL, smooth = NULL, inter #' #' #' @examples -#' \dontrun{ -#' result <- readRDS("./tests/testthat/previous-results/lm_result.rds") -#' temp_dir <- tempdir() -#' diag_save(temp_dir, result) +#' # Initialize result to NULL for safety +#' result <- NULL +#' +#' # Check if the previous results file exists and load it, or run `visual_prep` +#' if (file.exists("./tests/testthat/previous-results/lm_result.rds")) { +#' result <- readRDS("./tests/testthat/previous-results/lm_result.rds") +#' } +#' +#' # Use the result if it is available +#' if (!is.null(result)) { +#' temp_dir <- tempdir() +#' diag_save(temp_dir, result) +#' message("Diagnostics saved to: ", temp_dir) +#' } else { +#' message("Result is NULL. Please ensure the file exists and is accessible.") #' } - diag_save <- function(path, result, use_quarto = TRUE){ quarto_package <- requireNamespace("quarto", quietly = TRUE) @@ -720,11 +729,25 @@ diag_save <- function(path, result, use_quarto = TRUE){ #' #' #' @examples -#' \dontrun{ -#' age_list <- readRDS("./tests/testthat/previous-results/age_list.rds") -#' temp_dir <- tempdir() -#' age_save(temp_dir, age_list ) +#' # Initialize result to NULL for safety +#' age_list <- NULL +#' +#' # Check if the previous results file exists and load it +#' if (file.exists("./tests/testthat/previous-results/age_list.rds")) { +#' age_list <- readRDS("./tests/testthat/previous-results/age_list.rds") #' } +#' +#' # Use the result if it is available +#' if (!is.null(age_list)) { +#' temp_dir <- tempdir() +#' age_save(temp_dir, age_list) +#' message("Age trend table saved to: ", temp_dir) +#' } else { +#' message("Age list is NULL. Please ensure the file exists and is accessible.") +#' } +#' + + age_save <- function(path, age_list){ @@ -783,22 +806,26 @@ age_save <- function(path, age_list){ #' @export #' #' @examples -#' \dontrun{ -#' set.seed(123) -#' sub_df <- data.frame( -#' age = seq(1, 20, length.out = 100), -#' height = 50 + 2.5 * seq(1, 20, length.out = 100) + rnorm(100, 0, 5) -#' ) -#' -#' mdl <- gamlss(height ~ pb(age), data = sub_df, family = NO()) -#' -#' quantile_function <- getQuantileRefactored( -#' obj = mdl, -#' term = "age", -#' quantile = c(0.25, 0.5, 0.75), -#' data = sub_df -#' ) -#' } +#' if (requireNamespace("gamlss", quietly = TRUE)) { +#' library(gamlss) +#' set.seed(123) +#' sub_df <- data.frame( +#' age = seq(1, 20, length.out = 100), +#' height = 50 + 2.5 * seq(1, 20, length.out = 100) + rnorm(100, 0, 5) +#' ) +#' +#' mdl <- gamlss(height ~ pb(age), data = sub_df, family = NO()) +#' +#' quantile_function <- getQuantileRefactored( +#' obj = mdl, +#' term = "age", +#' quantile = c(0.25, 0.5, 0.75), +#' data = sub_df +#' ) +#' }else{ +#' message("The 'gamlss' package is not installed. Please install it to run this example.") +#' } + getQuantileRefactored <- function(obj, term, quantile, data, n.points = 100, fixed.at = list()) { if (is.null(obj) || !inherits(obj, "gamlss")) diff --git a/R/age_shiny.R b/R/age_shiny.R index a6fafbc..b8fa9a9 100644 --- a/R/age_shiny.R +++ b/R/age_shiny.R @@ -26,8 +26,8 @@ #' colnames(sub_df) <- c("y", "age", "sex", "icv") #' age_list <- list("Volume_1" = age_list_gen(sub_df = sub_df)) #' quantile_type <- c("quantile_25", "median", "quantile_75") -#' \dontrun{ -#' age_shiny(age_list = age_list, features = "Volume_1", quantile_type = quantile_type) +#' if(interactive()){ +#' age_shiny(age_list = age_list, features = "Volume_1", quantile_type = quantile_type) #' } @@ -339,10 +339,20 @@ age_list_gen <- function(sub_df, lq = 0.25, hq = 0.75, mu = "smooth", sigma = "s #' @export #' #' @examples -#' \dontrun{ -#' customize_percentile(age_list, feature = "Volume_1", q = 0.5, s = "F") +#' # Initialize result to NULL for safety +#' age_list <- NULL +#' +#' # Check if the previous results file exists and load it +#' if (file.exists("./tests/testthat/previous-results/age_list.rds")) { +#' age_list <- readRDS("./tests/testthat/previous-results/age_list.rds") +#' } +#' +#' # Use the result if it is available +#' if (!is.null(age_list)) { +#' customize_percentile(age_list, feature = "Volume_1", q = 0.5, s = "F") +#' } else { +#' message("Age list is NULL. Please ensure the file exists and is accessible.") #' } - customize_percentile <- function(age_list, feature, q = 0.75, s = "F"){ mdl_sex <- age_list[[feature]]$model @@ -377,8 +387,19 @@ customize_percentile <- function(age_list, feature, q = 0.75, s = "F"){ #' @export #' #' @examples -#' \dontrun{ -#' cus_result_gen(age_list, customized_q = 0.75, f = "Volume_1") +#' # Initialize result to NULL for safety +#' age_list <- NULL +#' +#' # Check if the previous results file exists and load it +#' if (file.exists("./tests/testthat/previous-results/age_list.rds")) { +#' age_list <- readRDS("./tests/testthat/previous-results/age_list.rds") +#' } +#' +#' # Use the result if it is available +#' if (!is.null(age_list)) { +#' cus_result_gen(age_list, customized_q = 0.75, f = "Volume_1") +#' } else { +#' message("Age list is NULL. Please ensure the file exists and is accessible.") #' } cus_result_gen <- function(age_list, customized_q = 0.75, f){ @@ -415,16 +436,27 @@ cus_result_gen <- function(age_list, customized_q = 0.75, f){ #' @export #' #' @examples -#' \dontrun{ -#' # Generate a plot for a specific feature and quantile -#' age_trend_plot( -#' age_list = age_list, -#' f = "Volume_1", -#' s = "F", -#' q = "customization", -#' cus_list = customized_results, -#' use_plotly = TRUE -#' ) +#' # Initialize result to NULL for safety +#' age_list <- NULL +#' +#' # Check if the previous results file exists and load it +#' if (file.exists("./tests/testthat/previous-results/age_list.rds")) { +#' age_list <- readRDS("./tests/testthat/previous-results/age_list.rds") +#' } +#' +#' # Use the result if it is available +#' if (!is.null(age_list)) { +#' customized_results <- cus_result_gen(age_list, customized_q = 0.75, f = "Volume_1") +#' age_trend_plot( +#' age_list = age_list, +#' f = "Volume_1", +#' s = "F", +#' q = "customization", +#' cus_list = customized_results, +#' use_plotly = TRUE +#' ) +#' } else { +#' message("Age list is NULL. Please ensure the file exists and is accessible.") #' } age_trend_plot <- function(age_list, f, s = "none", q = "median", cus_list = NULL, use_plotly = TRUE){ @@ -615,12 +647,20 @@ age_trend_plot <- function(age_list, f, s = "none", q = "median", cus_list = NUL #' The output table is formatted using the `DT` package with additional features, such as CSV and Excel export options. #' #' @examples -#' \dontrun{ -#' # Generate table for females at the 50th percentile -#' age_table_gen(result, q = "median", s = "F") +#' # Initialize result to NULL for safety +#' age_list <- NULL +#' +#' # Check if the previous results file exists and load it +#' if (file.exists("./tests/testthat/previous-results/age_list.rds")) { +#' age_list <- readRDS("./tests/testthat/previous-results/age_list.rds") +#' } #' -#' # Generate comparison table for females vs. males at the 75th percentile -#' age_table_gen(result, q = "quantile_75", s = "F vs M") +#' # Use the result if it is available +#' if (!is.null(age_list)) { +#' result <- age_list[[1]] +#' age_table_gen(result, q = "median", s = "F") +#' } else { +#' message("Age list is NULL. Please ensure the file exists and is accessible.") #' } #' #' @export diff --git a/R/comfam_shiny.R b/R/comfam_shiny.R index 598d0f0..3ad2e7f 100644 --- a/R/comfam_shiny.R +++ b/R/comfam_shiny.R @@ -25,8 +25,8 @@ #' result_lm <- visual_prep(type = "lm", features = colnames(adni)[43:53], #' batch = "manufac", covariates = c("AGE", "SEX", "DIAGNOSIS"), #' df = head(adni, 500), cores = 1) -#' \dontrun{ -#' comfam_shiny(result = result_lm) +#' if (interactive()) { +#' comfam_shiny(result = result_lm) #' } @@ -950,9 +950,20 @@ comfam_shiny <- function(result, after = FALSE){ #' - `"eb_scale"`: Empirical Bayes scale parameter density plots. #' #' @examples -#' \dontrun{ -#' combat_plot_gen(result, f = "Feature1", plot_name = "batch_density") -#' combat_plot_gen(result, f = "Feature1", c = "Age", plot_name = "cov_feature") +#' # Initialize result to NULL for safety +#' result <- NULL +#' +#' # Check if the previous results file exists and load it, or run `visual_prep` +#' if (file.exists("./tests/testthat/previous-results/lm_result.rds")) { +#' result <- readRDS("./tests/testthat/previous-results/lm_result.rds") +#' } +#' +#' # Use the result if it is available +#' if (!is.null(result)) { +#' combat_plot_gen(result, f = "Feature1", plot_name = "batch_density") +#' combat_plot_gen(result, f = "Feature1", c = "Age", plot_name = "cov_feature") +#' } else { +#' message("Result is NULL. Please ensure the file exists and is accessible.") #' } #' #' @export @@ -1507,10 +1518,21 @@ combat_plot_gen <- function(result, f = NULL, batch_control = "No", batch_level #' The function dynamically generates tables based on the `table_name` parameter. #' #' @examples -#' \dontrun{ -#' combat_table_gen(result, table_name = "data_overview") -#' combat_table_gen(result, table_name = "cov_table", c = "Age") -#' combat_table_gen(result, table_name = "pc_variance", PC1 = "PC1", PC2 = "PC2") +#' # Initialize result to NULL for safety +#' result <- NULL +#' +#' # Check if the previous results file exists and load it, or run `visual_prep` +#' if (file.exists("./tests/testthat/previous-results/lm_result.rds")) { +#' result <- readRDS("./tests/testthat/previous-results/lm_result.rds") +#' } +#' +#' # Use the result if it is available +#' if (!is.null(result)) { +#' combat_table_gen(result, table_name = "data_overview") +#' combat_table_gen(result, table_name = "cov_table", c = "Age") +#' combat_table_gen(result, table_name = "pc_variance", PC1 = "PC1", PC2 = "PC2") +#' } else { +#' message("Result is NULL. Please ensure the file exists and is accessible.") #' } #' #' @export diff --git a/man/age_save.Rd b/man/age_save.Rd index a63dd2b..589a3bb 100644 --- a/man/age_save.Rd +++ b/man/age_save.Rd @@ -18,9 +18,21 @@ This function does not return a value. It saves the data to the specified file. Save all brain age trends into a single Excel file. } \examples{ -\dontrun{ -age_list <- readRDS("./tests/testthat/previous-results/age_list.rds") -temp_dir <- tempdir() -age_save(temp_dir, age_list ) +# Initialize result to NULL for safety +age_list <- NULL + +# Check if the previous results file exists and load it +if (file.exists("./tests/testthat/previous-results/age_list.rds")) { + age_list <- readRDS("./tests/testthat/previous-results/age_list.rds") +} + +# Use the result if it is available +if (!is.null(age_list)) { + temp_dir <- tempdir() + age_save(temp_dir, age_list) + message("Age trend table saved to: ", temp_dir) +} else { + message("Age list is NULL. Please ensure the file exists and is accessible.") } + } diff --git a/man/age_shiny.Rd b/man/age_shiny.Rd index a07396b..7028d22 100644 --- a/man/age_shiny.Rd +++ b/man/age_shiny.Rd @@ -31,7 +31,7 @@ sub_df <- age_df[,c(features[1], "age", "sex", "ICV_baseline")] |> na.omit() colnames(sub_df) <- c("y", "age", "sex", "icv") age_list <- list("Volume_1" = age_list_gen(sub_df = sub_df)) quantile_type <- c("quantile_25", "median", "quantile_75") -\dontrun{ -age_shiny(age_list = age_list, features = "Volume_1", quantile_type = quantile_type) +if(interactive()){ + age_shiny(age_list = age_list, features = "Volume_1", quantile_type = quantile_type) } } diff --git a/man/age_table_gen.Rd b/man/age_table_gen.Rd index 31f35c1..be79afe 100644 --- a/man/age_table_gen.Rd +++ b/man/age_table_gen.Rd @@ -43,12 +43,20 @@ It calculates percentage changes in predicted volume values for easier interpret The output table is formatted using the \code{DT} package with additional features, such as CSV and Excel export options. } \examples{ -\dontrun{ -# Generate table for females at the 50th percentile -age_table_gen(result, q = "median", s = "F") +# Initialize result to NULL for safety +age_list <- NULL + +# Check if the previous results file exists and load it +if (file.exists("./tests/testthat/previous-results/age_list.rds")) { + age_list <- readRDS("./tests/testthat/previous-results/age_list.rds") +} -# Generate comparison table for females vs. males at the 75th percentile -age_table_gen(result, q = "quantile_75", s = "F vs M") +# Use the result if it is available +if (!is.null(age_list)) { + result <- age_list[[1]] + age_table_gen(result, q = "median", s = "F") +} else { + message("Age list is NULL. Please ensure the file exists and is accessible.") } } diff --git a/man/age_trend_plot.Rd b/man/age_trend_plot.Rd index 1d5b84d..421ac58 100644 --- a/man/age_trend_plot.Rd +++ b/man/age_trend_plot.Rd @@ -43,15 +43,26 @@ It supports customization for quantile visualization and uses precomputed result for enhanced flexibility. } \examples{ -\dontrun{ -# Generate a plot for a specific feature and quantile -age_trend_plot( - age_list = age_list, - f = "Volume_1", - s = "F", - q = "customization", - cus_list = customized_results, - use_plotly = TRUE -) +# Initialize result to NULL for safety +age_list <- NULL + +# Check if the previous results file exists and load it +if (file.exists("./tests/testthat/previous-results/age_list.rds")) { + age_list <- readRDS("./tests/testthat/previous-results/age_list.rds") +} + +# Use the result if it is available +if (!is.null(age_list)) { + customized_results <- cus_result_gen(age_list, customized_q = 0.75, f = "Volume_1") + age_trend_plot( + age_list = age_list, + f = "Volume_1", + s = "F", + q = "customization", + cus_list = customized_results, + use_plotly = TRUE + ) +} else { + message("Age list is NULL. Please ensure the file exists and is accessible.") } } diff --git a/man/combat_plot_gen.Rd b/man/combat_plot_gen.Rd index bdbef7a..a092fb0 100644 --- a/man/combat_plot_gen.Rd +++ b/man/combat_plot_gen.Rd @@ -82,9 +82,20 @@ The function dynamically generates plots based on the \code{plot_name} parameter } } \examples{ -\dontrun{ -combat_plot_gen(result, f = "Feature1", plot_name = "batch_density") -combat_plot_gen(result, f = "Feature1", c = "Age", plot_name = "cov_feature") +# Initialize result to NULL for safety +result <- NULL + +# Check if the previous results file exists and load it, or run `visual_prep` +if (file.exists("./tests/testthat/previous-results/lm_result.rds")) { + result <- readRDS("./tests/testthat/previous-results/lm_result.rds") +} + +# Use the result if it is available +if (!is.null(result)) { + combat_plot_gen(result, f = "Feature1", plot_name = "batch_density") + combat_plot_gen(result, f = "Feature1", c = "Age", plot_name = "cov_feature") +} else { + message("Result is NULL. Please ensure the file exists and is accessible.") } } diff --git a/man/combat_table_gen.Rd b/man/combat_table_gen.Rd index 81e4298..a23e724 100644 --- a/man/combat_table_gen.Rd +++ b/man/combat_table_gen.Rd @@ -52,10 +52,21 @@ statistical test results, PCA summaries, and covariate distributions. The function dynamically generates tables based on the \code{table_name} parameter. } \examples{ -\dontrun{ -combat_table_gen(result, table_name = "data_overview") -combat_table_gen(result, table_name = "cov_table", c = "Age") -combat_table_gen(result, table_name = "pc_variance", PC1 = "PC1", PC2 = "PC2") +# Initialize result to NULL for safety +result <- NULL + +# Check if the previous results file exists and load it, or run `visual_prep` +if (file.exists("./tests/testthat/previous-results/lm_result.rds")) { + result <- readRDS("./tests/testthat/previous-results/lm_result.rds") +} + +# Use the result if it is available +if (!is.null(result)) { + combat_table_gen(result, table_name = "data_overview") + combat_table_gen(result, table_name = "cov_table", c = "Age") + combat_table_gen(result, table_name = "pc_variance", PC1 = "PC1", PC2 = "PC2") +} else { + message("Result is NULL. Please ensure the file exists and is accessible.") } } diff --git a/man/comfam_shiny.Rd b/man/comfam_shiny.Rd index 8e19fea..88b3304 100644 --- a/man/comfam_shiny.Rd +++ b/man/comfam_shiny.Rd @@ -25,7 +25,7 @@ user's default web browser. Execution is blocked until the app is closed. result_lm <- visual_prep(type = "lm", features = colnames(adni)[43:53], batch = "manufac", covariates = c("AGE", "SEX", "DIAGNOSIS"), df = head(adni, 500), cores = 1) -\dontrun{ -comfam_shiny(result = result_lm) +if (interactive()) { + comfam_shiny(result = result_lm) } } diff --git a/man/cus_result_gen.Rd b/man/cus_result_gen.Rd index 5025801..57a674e 100644 --- a/man/cus_result_gen.Rd +++ b/man/cus_result_gen.Rd @@ -25,7 +25,18 @@ This function utilizes the GAMLSS model to compute predictions for the specified The results include predictions for both the specified quantile and the median, enabling enhanced visualization. } \examples{ -\dontrun{ -cus_result_gen(age_list, customized_q = 0.75, f = "Volume_1") +# Initialize result to NULL for safety +age_list <- NULL + +# Check if the previous results file exists and load it +if (file.exists("./tests/testthat/previous-results/age_list.rds")) { + age_list <- readRDS("./tests/testthat/previous-results/age_list.rds") +} + +# Use the result if it is available +if (!is.null(age_list)) { + cus_result_gen(age_list, customized_q = 0.75, f = "Volume_1") +} else { + message("Age list is NULL. Please ensure the file exists and is accessible.") } } diff --git a/man/customize_percentile.Rd b/man/customize_percentile.Rd index 224ee3d..64a7392 100644 --- a/man/customize_percentile.Rd +++ b/man/customize_percentile.Rd @@ -28,7 +28,18 @@ The predictions are computed over a sequence of ages (\code{age_test}) that span The function adjusts for fixed covariates such as \code{icv} by using their mean values from the input data. } \examples{ -\dontrun{ -customize_percentile(age_list, feature = "Volume_1", q = 0.5, s = "F") +# Initialize result to NULL for safety +age_list <- NULL + +# Check if the previous results file exists and load it +if (file.exists("./tests/testthat/previous-results/age_list.rds")) { + age_list <- readRDS("./tests/testthat/previous-results/age_list.rds") +} + +# Use the result if it is available +if (!is.null(age_list)) { + customize_percentile(age_list, feature = "Volume_1", q = 0.5, s = "F") +} else { + message("Age list is NULL. Please ensure the file exists and is accessible.") } } diff --git a/man/diag_save.Rd b/man/diag_save.Rd index 3af4dfb..837f984 100644 --- a/man/diag_save.Rd +++ b/man/diag_save.Rd @@ -20,9 +20,20 @@ This function does not return a value. It saves the data to the specified file. Save all the batch effect diagnosis results in a single Excel file or a Quarto report. } \examples{ -\dontrun{ -result <- readRDS("./tests/testthat/previous-results/lm_result.rds") -temp_dir <- tempdir() -diag_save(temp_dir, result) +# Initialize result to NULL for safety +result <- NULL + +# Check if the previous results file exists and load it, or run `visual_prep` +if (file.exists("./tests/testthat/previous-results/lm_result.rds")) { + result <- readRDS("./tests/testthat/previous-results/lm_result.rds") +} + +# Use the result if it is available +if (!is.null(result)) { + temp_dir <- tempdir() + diag_save(temp_dir, result) + message("Diagnostics saved to: ", temp_dir) +} else { + message("Result is NULL. Please ensure the file exists and is accessible.") } } diff --git a/man/form_gen.Rd b/man/form_gen.Rd index 4d7141e..8917eee 100644 --- a/man/form_gen.Rd +++ b/man/form_gen.Rd @@ -24,7 +24,7 @@ A string of formula Generate appropriate formula for ComBatFamily models } \examples{ -covariates = adni[, c("AGE", "SEX")] +covariates <- adni[, c("AGE", "SEX")] form_gen(x = "lm", c = covariates) } diff --git a/man/getQuantileRefactored.Rd b/man/getQuantileRefactored.Rd index 5b0daf3..4625951 100644 --- a/man/getQuantileRefactored.Rd +++ b/man/getQuantileRefactored.Rd @@ -44,20 +44,23 @@ It then computes the distribution parameters for the GAMLSS model and calculates quantile function for the distribution family. } \examples{ -\dontrun{ -set.seed(123) -sub_df <- data.frame( - age = seq(1, 20, length.out = 100), - height = 50 + 2.5 * seq(1, 20, length.out = 100) + rnorm(100, 0, 5) -) +if (requireNamespace("gamlss", quietly = TRUE)) { + library(gamlss) + set.seed(123) + sub_df <- data.frame( + age = seq(1, 20, length.out = 100), + height = 50 + 2.5 * seq(1, 20, length.out = 100) + rnorm(100, 0, 5) + ) -mdl <- gamlss(height ~ pb(age), data = sub_df, family = NO()) + mdl <- gamlss(height ~ pb(age), data = sub_df, family = NO()) -quantile_function <- getQuantileRefactored( - obj = mdl, - term = "age", - quantile = c(0.25, 0.5, 0.75), - data = sub_df -) -} + quantile_function <- getQuantileRefactored( + obj = mdl, + term = "age", + quantile = c(0.25, 0.5, 0.75), + data = sub_df + ) + }else{ + message("The 'gamlss' package is not installed. Please install it to run this example.") + } } diff --git a/man/interaction_gen.Rd b/man/interaction_gen.Rd index 30e9cca..05a7468 100644 --- a/man/interaction_gen.Rd +++ b/man/interaction_gen.Rd @@ -35,11 +35,10 @@ interaction_gen( Generate appropriate interaction terms for regression models. } \examples{ -\dontrun{ interaction_gen(type = "lm", covariates = c("AGE", "SEX", "DIAGNOSIS"), interaction = "AGE,DIAGNOSIS") interaction_gen(type = "gam", covariates = c("AGE", "SEX", "DIAGNOSIS"), smooth = "AGE", smooth_int_type = "linear", interaction = "AGE,DIAGNOSIS") -} + }