Skip to content

Commit

Permalink
optimized examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Zheng206 committed Jan 17, 2025
1 parent 3d22a60 commit 1daebd1
Show file tree
Hide file tree
Showing 10 changed files with 57 additions and 42 deletions.
6 changes: 3 additions & 3 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Version: 1.0.0
Date: 2025-01-16 21:48:48 UTC
SHA: 622b2ed3c22c6b75f235d150d3a04da91b7626b4
Version: 1.0.1
Date: 2025-01-17 21:50:05 UTC
SHA: 3d22a604255545ce99a9016c3526b031e832cf9b
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: ComBatFamQC
Title: Comprehensive Batch Effect Diagnostics and Harmonization
Version: 1.0.1
Version: 1.0.2
Authors@R: c(
person("Zheng", "Ren", email = "zren1422@gmail.com", role = c("aut", "cre", "cph"), comment = c(ORCID = "0009-0006-2430-4625")),
person("Andrew", "Chen", email = "chen1764@gmail.com", role = c("aut", "cph"), comment = c(ORCID = "0000-0002-5027-6422")),
Expand Down
25 changes: 15 additions & 10 deletions R/Help_Func.R
Original file line number Diff line number Diff line change
Expand Up @@ -644,15 +644,18 @@ interaction_gen <- function(type = "lm", covariates = NULL, smooth = NULL, inter
#'
#'
#' @examples
#' result <- visual_prep(type = "lm", features = "thickness.left.cuneus",
#' batch = "manufac", covariates = "AGE", df = adni[1:100, ], mdmr = FALSE, cores = 1)
#' temp_dir <- tempfile()
#' dir.create(temp_dir)
#' diag_save(temp_dir, result)
#' message("Diagnostics saved to: ", temp_dir)
#' if(interactive()){
#' result <- visual_prep(type = "lm", features = "thickness.left.cuneus",
#' batch = "manufac", covariates = "AGE", df = adni[1:100, ], mdmr = FALSE, cores = 1)
#' temp_dir <- tempfile()
#' dir.create(temp_dir)
#' diag_save(temp_dir, result, quarto = FALSE)
#' message("Diagnostics saved to: ", temp_dir)
#' unlink(temp_dir, recursive = TRUE) # Clean up the temporary directory
#' }
#' \dontshow{
#' # Clean up the temporary file
#' unlink(temp_dir, recursive = TRUE)
#' # Ensure temp_dir exists before attempting cleanup
#' if (exists("temp_dir")) unlink(temp_dir, recursive = TRUE)
#' }

diag_save <- function(path, result, use_quarto = TRUE){
Expand Down Expand Up @@ -725,6 +728,7 @@ diag_save <- function(path, result, use_quarto = TRUE){
#'
#'
#' @examples
#' if(interactive()){
#' sub_df <- age_df[,c("Volume_1", "age", "sex", "ICV_baseline")] |> na.omit()
#' colnames(sub_df) <- c("Volume_1", "age", "sex", "icv")
#' age_list <- list("Volume_1" = age_list_gen(sub_df = sub_df))
Expand All @@ -733,10 +737,11 @@ diag_save <- function(path, result, use_quarto = TRUE){
#' dir.create(temp_dir)
#' age_save(temp_dir, age_list)
#' message("Age trend table saved to: ", temp_dir)
#' \dontshow{
#' # Clean up the temporary file
#' unlink(temp_dir, recursive = TRUE)
#' }
#' \dontshow{
#' if (exists("temp_dir")) unlink(temp_dir, recursive = TRUE)
#' }



Expand Down
8 changes: 4 additions & 4 deletions R/comfam_shiny.R
Original file line number Diff line number Diff line change
Expand Up @@ -950,9 +950,9 @@ comfam_shiny <- function(result, after = FALSE){
#' - `"eb_scale"`: Empirical Bayes scale parameter density plots.
#'
#' @examples
#' result <- visual_prep(type = "lm", features = "thickness.left.cuneus",
#' batch = "manufac", covariates = "AGE", df = adni, mdmr = FALSE, cores = 1)
#' if(interactive()){
#' result <- visual_prep(type = "lm", features = "thickness.left.cuneus",
#' batch = "manufac", covariates = "AGE", df = adni[1:100, ], mdmr = FALSE, cores = 1)
#' combat_plot_gen(result, f = "thickness.left.cuneus", plot_name = "batch_density")
#' combat_plot_gen(result, f = "thickness.left.cuneus", c = "AGE", plot_name = "cov_feature")
#' }
Expand Down Expand Up @@ -1509,9 +1509,9 @@ combat_plot_gen <- function(result, f = NULL, batch_control = "No", batch_level
#' The function dynamically generates tables based on the `table_name` parameter.
#'
#' @examples
#' result <- visual_prep(type = "lm", features = "thickness.left.cuneus",
#' batch = "manufac", covariates = "AGE", df = adni, mdmr = FALSE, cores = 1)
#' if(interactive()){
#' result <- visual_prep(type = "lm", features = "thickness.left.cuneus",
#' batch = "manufac", covariates = "AGE", df = adni[1:100, ], mdmr = FALSE, cores = 1)
#' combat_table_gen(result, table_name = "cov_table", c = "AGE")
#' combat_table_gen(result, table_name = "pc_variance", PC1 = "PC1", PC2 = "PC2")
#' }
Expand Down
4 changes: 2 additions & 2 deletions codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"codeRepository": "https://github.com/Zheng206/ComBatFamQC",
"issueTracker": "https://github.com/Zheng206/ComBatFamQC/issues",
"license": "https://spdx.org/licenses/MIT",
"version": "1.0.1",
"version": "1.0.2",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand Down Expand Up @@ -423,7 +423,7 @@
},
"SystemRequirements": null
},
"fileSize": "4966.528KB",
"fileSize": "4967.019KB",
"releaseNotes": "https://github.com/Zheng206/ComBatFamQC/blob/master/NEWS.md",
"readme": "https://github.com/Zheng206/ComBatFamQC/blob/main/README.md",
"contIntegration": ["https://github.com/Zheng206/ComBatFamQC/actions/workflows/R-CMD-check.yaml", "https://app.codecov.io/gh/Zheng206/ComBatFamQC"],
Expand Down
21 changes: 13 additions & 8 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
## R CMD check results

0 errors | 0 warnings | 1 note

* This is a new release.

## Resubmission
This is a resubmission of [ComBatFamQC] (version 1.0.1) in response to CRAN comments.
This is a resubmission of 'ComBatFamQC' (version 1.0.2) in response to CRAN comments.

### Issues Addressed:
1. Updated the package description to enclose the package name in single quotes: 'ComBatFamQC'.
2. Added references in the description field to describe the methods, following CRAN guidelines for formatting (e.g., authors (year) <doi:...>).
2. Added references in the description field to describe the methods, formatted per CRAN guidelines (e.g., authors (year) <doi:...>).
3. Replaced all instances of `print()` with `message()` in `R/visual_prep.R` and `R/Help_Func.R` to align with CRAN's recommended practices for console output.
4. Ensured the use of `tempfile()` for creating temporary directories in examples, vignettes, and tests to comply with CRAN's file handling policies.
5. Cleaned up all temporary files using `unlink()`.
6. Optimized examples to ensure they run in less than 5 seconds.

### Notes Addressed:

The flagged words (e.g., "Pomponio," "centiles," "et al.") are part of valid citations and technical terms used in the description.

### R CMD check results

0 errors | 0 warnings | 0 notes


Thank you so much for reviewing the package again.
6 changes: 4 additions & 2 deletions man/age_save.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/combat_plot_gen.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/combat_table_gen.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 11 additions & 8 deletions man/diag_save.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1daebd1

Please sign in to comment.