diff --git a/NAMESPACE b/NAMESPACE index 1e78abe..64258ca 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,6 +1,5 @@ # Generated by roxygen2: do not edit by hand -export(check_dependencies) export(do_AffinityAnalysisPlot) export(do_AlluvialPlot) export(do_BarPlot) diff --git a/NEWS.md b/NEWS.md index b368801..d2fd523 100644 --- a/NEWS.md +++ b/NEWS.md @@ -3,6 +3,9 @@ ## General - Refactored startup messages to comply with CRAN policies. +## Removed functions +- Removed `SCpubr::check_dependencies()` to support the use of `SCpubr::package_report()`. + ## `SCpubr::do_EnrichmentHeatmap` - Fixed a bug that checked the pacakge dependencies for the wrong function. diff --git a/R/utils.R b/R/utils.R index ea8f201..ad5f432 100644 --- a/R/utils.R +++ b/R/utils.R @@ -466,15 +466,11 @@ check_suggests <- function(function_name, passive = FALSE){ if(sum(!pkgs) > 0){ missing_pkgs <- names(pkgs[base::isFALSE(pkgs)]) if (base::isFALSE(passive)){ - if (base::isFALSE(requireNamespace("cli", quietly = TRUE))){ - stop(paste0(add_cross(), crayon_body("Packages "), - paste(vapply(missing_pkgs, crayon_key, FUN.VALUE = character(1)), collapse = crayon_body(", ")), - crayon_body(" must be installed to use "), - crayon_key(function_name), - crayon_body(".")), call. = FALSE) - } else { - check_dependencies(function_name = function_name) - } + stop(paste0(add_cross(), crayon_body("Packages "), + paste(vapply(missing_pkgs, crayon_key, FUN.VALUE = character(1)), collapse = crayon_body(", ")), + crayon_body(" must be installed to use "), + crayon_key(function_name), + crayon_body(".")), call. = FALSE) } } @@ -484,245 +480,7 @@ check_suggests <- function(function_name, passive = FALSE){ # nocov end } -#' Check SCpubr current function dependencies. -#' -#' @param function_name \strong{\code{\link[base]{character}}} | Name of an exported function from SCpubr. If NULL, return all functions. -#' @param return_dependencies \strong{\code{\link[base]{logical}}} | Whether to have the dependencies as an output object instead of a printed message. -#' @param bioconductor_repo \strong{\code{\link[base]{bioconductor_repo}}} | Link to the repository that should be used to check \strong{\code{Bioconductor}} packages. -#' @param cran_repo \strong{\code{\link[base]{cran_repo}}} | Link to the repository that should be used to check \strong{\code{CRAN}} packages. -#' @return None -#' @export -#' -#' @examples -#' \donttest{ -#' # See all dependencies. -#' SCpubr::check_dependencies() -#' -#' # See the dependencies for a single package. -#' SCpubr::check_dependencies(function_name = "do_DimPlot") -#' } -check_dependencies <- function(function_name = NULL, - return_dependencies = FALSE, - bioconductor_repo = "https://bioconductor.org/packages/release/bioc", - cran_repo = "http://cran.us.r-project.org"){ - # nocov start - if (base::isFALSE(requireNamespace("cli", quietly = TRUE))){ - message(paste(rep("-", 63), collapse = "")) - message('This is a placeholder message. Please install "cli" package to have an optimal experience using the package.') - message(paste(rep("-", 63), collapse = "")) - } else { - # nocov end - pkg_list <- return_dependencies() - # The function is not in the current list of possibilities. - if (!(is.null(function_name))){ - for (func in function_name){ - if (!(func %in% names(pkg_list))){ - stop(paste0(add_cross(), crayon_key(function_name), crayon_body(" is not an accepted function name.")), call. = FALSE) - } - } - } - - non_seurat_functions <- c("save_Plot", - "do_VolcanoPlot", - "do_LigandReceptorPlot", - "do_ColorPalette") - - if (base::isFALSE(return_dependencies)){ - func_list <- sort(names(pkg_list[!(names(pkg_list) %in% "Essentials")])) - if (!(is.null(function_name))){ - func_list <- sort(function_name) - } - - # nocov start - if (base::isFALSE(requireNamespace("cli", quietly = TRUE))){ - for (func in func_list){ - packages <- sort(c(pkg_list[[func]], pkg_list[["Essentials"]])) - if (func %in% non_seurat_functions){ - packages <- packages[!(packages %in% c("Seurat", "SeuratObject"))] - } - } - crayon_key(func) - paste(vapply(packages, crayon_body, FUN.VALUE = character(1)), collapse = ", ") - } else { - # nocov end - - system_version <- as.character(utils::packageVersion("SCpubr")) - - if (rev(strsplit(as.character(system_version), split = "\\.")[[1]])[1] >= 9000){ - parts <- strsplit(as.character(system_version), split = "\\.")[[1]] - parts[[length(parts)]] <- cli::col_cyan(parts[[length(parts)]]) - system_version <- paste(parts, collapse = ".") - } - - header <- cli::rule(left = paste0(crayon_body("SCpubr "), - crayon_key(system_version)), line_col = "cadetblue") - - rlang::inform(paste0(header, "\n", "\n")) - - for (func in func_list){ - if (rev(strsplit(as.character(as.character(utils::packageVersion("SCpubr"))), split = "\\.")[[1]])[1] >= 9000){ - if (func %in% c("do_LigandReceptorPlot", - "save_Plot", - "do_MetadataPlot", - "do_SCExpressionHeatmap", - "do_SCEnrichmentHeatmap", - "do_AffinityAnalysisPlot", - "do_DiffusionMapPlot")){ - func.name <- paste0(func, cli::col_cyan(" | DEV")) - nchar.use <- nchar(func) + nchar(" | DEV") - } else { - func.name <- func - nchar.use <- nchar(func) - } - # nocov start - } else { - if (func %in% c("do_LigandReceptorPlot", - "save_Plot", - "do_MetadataPlot", - "do_SCExpressionHeatmap", - "do_SCEnrichmentHeatmap", - "do_AffinityAnalysisPlot", - "do_DiffusionMapPlot")){ - next - } else { - func.name <- func - nchar.use <- nchar(func) - } - } - # nocov end - r_packages <- utils::available.packages(repos = c(bioconductor_repo, cran_repo))[, "Version"] - - packages <- sort(c(pkg_list[[func]], pkg_list[["Essentials"]])) - if (func %in% non_seurat_functions){ - packages <- packages[packages != "Seurat"] - } - - format_package_name <- function(package, - avail_packages, - max_length_packages, - max_length_version_available, - max_length_version_installed){ - color_version <- function(version, - max_version, - type){ - if (length(strsplit(as.character(version), split = "\\.")[[1]]) > 3){ - parts <- strsplit(as.character(version), split = "\\.")[[1]] - version_parts <- paste(parts[seq_len(length(parts) - 1)], collapse = ".") - dev_parts <- paste(parts[length(parts)], collapse = ".") - length.use <- nchar(version_parts) + nchar(dev_parts) + 1 - if (type == "installed"){ - version_parts <- paste0(paste(rep(" ", (max_version - length.use)), collapse = ""), version_parts) - version_parts <- crayon_key(version_parts) - dev_parts <- cli::col_cyan(dev_parts) - } else { - version_parts <- crayon_key(version_parts) - dev_parts <- paste0(dev_parts, paste(rep(" ", (max_version - length.use)), collapse = "")) - dev_parts <- cli::col_cyan(dev_parts) - } - parts <- c(version_parts, dev_parts) - version <- paste(parts, collapse = ".") - - } else { - parts <- strsplit(as.character(version), split = "\\.")[[1]] - version_parts <- paste(parts[seq_len(length(parts))], collapse = ".") - length.use <- nchar(version_parts) - times <- max_version - length.use - if (type == "installed"){ - version_parts <- paste0(paste(rep(" ", times), collapse = ""), version_parts) - version <- crayon_key(version_parts) - } else { - version_parts <- paste0(version_parts, paste(rep(" ", times), collapse = "")) - version <- crayon_key(version_parts) - } - } - return(version) - } - length.use <- max_length_packages - nchar(package) - package.use <- paste0(package, paste(rep(" ", length.use), collapse = "")) - if (isTRUE(requireNamespace(package, quietly = TRUE))){ - installed <- color_version(version = utils::packageVersion(package), - max_version = max_length_version_installed, - type = "installed") - - latest <- color_version(version = avail_packages[package], - max_version = max_length_version_available, - type = "available") - - if ((package == "ggplot2") & (utils::packageVersion(package) < "3.4.0")){ - intro <- paste0(cli::col_yellow(cli::style_bold("!")), - " ", - cli::col_magenta(package.use)) - } else if ((package == "dplyr") & (utils::packageVersion(package) < "1.1.0")){ - intro <- paste0(cli::col_yellow(cli::style_bold("!")), - " ", - cli::col_magenta(package.use)) - } else { - intro <- paste0(cli::col_green(cli::symbol$tick), - crayon_body(" "), - crayon_body(package.use)) - } - - name <- paste0(intro, - crayon_body(" "), - installed, - crayon_body(" | "), - latest) - return(name) - } else { - return(paste0(cli::col_red(cli::symbol$cross), - crayon_body(" "), - cli::col_red(package.use), - paste(rep(" ", max_length_version_installed), collapse = ""), - " ", - paste(rep(" ", max_length_version_available), collapse = ""))) - } - } - - - - packages_version <- vapply(packages, function(x){ifelse(isTRUE(requireNamespace(x, quietly = TRUE)), - as.character(utils::packageVersion(x)), - "NA")}, FUN.VALUE = character(1)) - avail_packages <- r_packages[packages] - avail_packages[is.na(avail_packages)] <- "GitHub" - names(avail_packages)[is.na(names(avail_packages))] <- "liana" - max_length_available <- max(vapply(avail_packages, nchar, FUN.VALUE = numeric(1))) - max_length_installed <- max(vapply(packages_version, nchar, FUN.VALUE = numeric(1))) - max_length_packages <- max(vapply(packages, nchar, FUN.VALUE = numeric(1))) - packages_mod <- vapply(packages, function(x){format_package_name(x, - avail_packages = avail_packages, - max_length_packages = max_length_packages, - max_length_version_available = max_length_available, - max_length_version_installed = max_length_installed)}, FUN.VALUE = character(1)) - - - counter <- 0 - print.list <- list() - print.vector <- NULL - for(item in packages_mod){ - counter <- counter + 1 - - if (counter %% 3 != 0){ - print.vector <- append(print.vector, item) - if (counter == length(packages_mod)){ - print.list[[item]] <- paste(print.vector, collapse = " ") - print.vector <- NULL - } - } else { - print.vector <- append(print.vector, item) - print.list[[item]] <- paste(print.vector, collapse = " ") - print.vector <- NULL - } - } - - rlang::inform(paste0(cli::rule(left = func.name, width = nchar.use + 6), "\n", "\n", paste(print.list, collapse = "\n"), "\n", "\n")) - } - } - } else { - return(pkg_list) - } - } -} + #' Generate a status report of SCpubr and its dependencies. #' @@ -730,8 +488,8 @@ check_dependencies <- function(function_name = NULL, #' #' @param startup \strong{\code{\link[base]{logical}}} | Whether the message should be displayed at startup, therefore, also containing welcoming messages and tips. If \strong{\code{FALSE}}, only the report itself will be printed. #' @param extended \strong{\code{\link[base]{logical}}} | Whether the message should also include installed packages, current and available version, and which \strong{\code{SCpubr}} functions can be used with the currently installed packages. -#' @param bioconductor_repo \strong{\code{\link[base]{bioconductor_repo}}} | Link to the repository that should be used to check \strong{\code{Bioconductor}} packages. -#' @param cran_repo \strong{\code{\link[base]{cran_repo}}} | Link to the repository that should be used to check \strong{\code{CRAN}} packages. +#' @param bioconductor_repo \strong{\code{\link[base]{character}}} | Link to the repository that should be used to check \strong{\code{Bioconductor}} packages. +#' @param cran_repo \strong{\code{\link[base]{character}}} | Link to the repository that should be used to check \strong{\code{CRAN}} packages. #' @return None #' @export #' @@ -739,13 +497,11 @@ check_dependencies <- function(function_name = NULL, #' #' \donttest{ #' # Print a package report. -#' SCpubr::package_report() +#' SCpubr::package_report(startup = FALSE, extended = FALSE) #' } package_report <- function(startup = FALSE, - extended = FALSE, - bioconductor_repo = "https://bioconductor.org/packages/release/bioc", - cran_repo = "http://cran.us.r-project.org"){ + extended = FALSE){ # nocov start if (base::isFALSE(requireNamespace("cli", quietly = TRUE)) | base::isFALSE(requireNamespace("rlang", quietly = TRUE))){ if (base::isFALSE(startup)){ @@ -802,152 +558,42 @@ package_report <- function(startup = FALSE, plotting <- paste0(cli::style_bold(cli::col_red(cli::symbol$heart)), " ", crayon_body("Happy plotting!")) - if (isTRUE(extended)){ - header <- cli::rule(left = paste0(crayon_body("SCpubr "), - crayon_key(system_version)), line_col = "cadetblue") - } else { - header <- cli::rule(left = paste0(crayon_body("SCpubr")), line_col = "cadetblue") - } + header <- cli::rule(left = paste0(crayon_body("SCpubr "), + crayon_key(utils::packageVersion("SCpubr"))), line_col = "cadetblue") if (isTRUE(extended)){ - - - updates_check <- cli::rule(left = "Package version", width = nchar("Package version") + 6) - - r_packages <- utils::available.packages(repos = c(bioconductor_repo, cran_repo))[, "Version"] - cran_version <- utils::available.packages(repos = cran_repo)["SCpubr", "Version"] - system_version <- as.character(utils::packageVersion("SCpubr")) - - l1 <- nchar(system_version) - l2 <- nchar(cran_version) - max_length <- max(c(l1, l2)) - - if (rev(strsplit(as.character(system_version), split = "\\.")[[1]])[1] >= 9000){ - parts <- strsplit(as.character(system_version), split = "\\.")[[1]] - parts[[length(parts)]] <- cli::col_cyan(parts[[length(parts)]]) - system_version <- paste(parts, collapse = ".") - } - - - system_version_message <- paste0(cli::col_magenta("Installed: "), cli::ansi_align(crayon_key(system_version), max_length, align = "right")) - cran_version_message <- paste0(cli::col_magenta("CRAN: "), cli::ansi_align(crayon_key(cran_version), max_length, align = "right")) - - - # nocov start - if (system_version < cran_version){ - veredict_message <- paste0(cli::col_yellow(cli::symbol$warning), - crayon_body(" There is a "), - crayon_key("new version"), - crayon_body(" available on"), - crayon_key("CRAN"), - crayon_body("!")) - } else { - # nocov end - veredict_message <- paste0(cli::col_green(cli::symbol$tick, - crayon_body(" Package is "), - crayon_key("up to date"), - crayon_body(" with latest "), - crayon_key("CRAN"), - crayon_body(" version!"))) - } - format_package_name <- function(package, - avail_packages, - max_length_packages, - max_length_version_available, - max_length_version_installed){ - color_version <- function(version, - max_version, - type){ - if (length(strsplit(as.character(version), split = "\\.")[[1]]) > 3){ - parts <- strsplit(as.character(version), split = "\\.")[[1]] - version_parts <- paste(parts[seq_len(length(parts) - 1)], collapse = ".") - dev_parts <- paste(parts[length(parts)], collapse = ".") - length.use <- nchar(version_parts) + nchar(dev_parts) + 1 - if (type == "installed"){ - version_parts <- paste0(paste(rep(" ", (max_version - length.use)), collapse = ""), version_parts) - version_parts <- crayon_key(version_parts) - dev_parts <- cli::col_cyan(dev_parts) - } else { - version_parts <- crayon_key(version_parts) - dev_parts <- paste0(dev_parts, paste(rep(" ", (max_version - length.use)), collapse = "")) - dev_parts <- cli::col_cyan(dev_parts) - } - parts <- c(version_parts, dev_parts) - version <- paste(parts, collapse = ".") - - } else { - parts <- strsplit(as.character(version), split = "\\.")[[1]] - version_parts <- paste(parts[seq_len(length(parts))], collapse = ".") - length.use <- nchar(version_parts) - times <- max_version - length.use - if (type == "installed"){ - version_parts <- paste0(paste(rep(" ", times), collapse = ""), version_parts) - version <- crayon_key(version_parts) - } else { - version_parts <- paste0(version_parts, paste(rep(" ", times), collapse = "")) - version <- crayon_key(version_parts) - } - } - return(version) - } + max_length_packages){ length.use <- max_length_packages - nchar(package) package.use <- paste0(package, paste(rep(" ", length.use), collapse = "")) if (isTRUE(requireNamespace(package, quietly = TRUE))){ - installed <- color_version(version = utils::packageVersion(package), - max_version = max_length_version_installed, - type = "installed") - - latest <- color_version(version = avail_packages[package], - max_version = max_length_version_available, - type = "available") - if ((package == "ggplot2") & (utils::packageVersion(package) < "3.4.0")){ - intro <- paste0(cli::col_yellow(cli::style_bold("!")), - " ", - cli::col_magenta(package.use)) + name <- paste0(cli::col_yellow(cli::style_bold("!")), + " ", + cli::col_magenta(package.use)) } else if ((package == "dplyr") & (utils::packageVersion(package) < "1.1.0")){ - intro <- paste0(cli::col_yellow(cli::style_bold("!")), - " ", - cli::col_magenta(package.use)) + name <- paste0(cli::col_yellow(cli::style_bold("!")), + " ", + cli::col_magenta(package.use)) } else { - intro <- paste0(cli::col_green(cli::symbol$tick), - crayon_body(" "), - crayon_body(package.use)) + name <- paste0(cli::col_green(cli::symbol$tick), + crayon_body(" "), + crayon_body(package.use)) } - - name <- paste0(intro, - crayon_body(" "), - installed, - crayon_body(" | "), - latest) + return(name) } else { return(paste0(cli::col_red(cli::symbol$cross), crayon_body(" "), - cli::col_red(package.use), - paste(rep(" ", max_length_version_installed), collapse = ""), - " ", - paste(rep(" ", max_length_version_available), collapse = ""))) + cli::col_red(package.use))) } } - packages <- sort(unique(unlist(check_dependencies(return_dependencies = TRUE)))) - packages_version <- vapply(packages, function(x){ifelse(isTRUE(requireNamespace(x, quietly = TRUE)), - as.character(utils::packageVersion(x)), - "NA")}, FUN.VALUE = character(1)) - avail_packages <- r_packages[packages] - avail_packages[is.na(avail_packages)] <- "GitHub" - names(avail_packages)[is.na(names(avail_packages))] <- "liana" - max_length_available <- max(vapply(avail_packages, nchar, FUN.VALUE = numeric(1))) - max_length_installed <- max(vapply(packages_version, nchar, FUN.VALUE = numeric(1))) + packages <- sort(unique(unlist(return_dependencies()))) max_length_packages <- max(vapply(packages, nchar, FUN.VALUE = numeric(1))) packages_mod <- vapply(packages, function(x){format_package_name(x, - avail_packages = avail_packages, - max_length_packages = max_length_packages, - max_length_version_available = max_length_available, - max_length_version_installed = max_length_installed)}, FUN.VALUE = character(1)) - functions <- sort(unique(names(check_dependencies(return_dependencies = TRUE)))) + max_length_packages = max_length_packages)}, FUN.VALUE = character(1)) + functions <- sort(unique(names(return_dependencies()))) if (rev(strsplit(as.character( as.character(utils::packageVersion("SCpubr"))), split = "\\.")[[1]])[1] >= 9000){ names.use <- unname(vapply(functions, function(x){if (x %in% c("do_LigandReceptorPlot", @@ -997,7 +643,7 @@ package_report <- function(startup = FALSE, for(item in packages_mod){ counter <- counter + 1 - if (counter %% 3 != 0){ + if (counter %% 4 != 0){ print.vector <- append(print.vector, item) if (counter == length(packages)){ print.list[[item]] <- paste(print.vector, collapse = " ") @@ -1036,7 +682,7 @@ package_report <- function(startup = FALSE, crayon_body(" ("), cli::style_bold(cli::col_green(cli::symbol$tick)), crayon_body(") and missing packages by a "), - crayon_key("cross"), + cli::col_red("cross"), crayon_body(" ("), cli::style_bold(cli::col_red(cli::symbol$cross)), crayon_body(").")) @@ -1050,13 +696,6 @@ package_report <- function(startup = FALSE, cli::style_bold(cli::col_yellow("!")), crayon_body(").")) - packages_tip3 <- paste0(cli::style_bold(cli::col_cyan(cli::symbol$info)), - crayon_body(" Packages version are displayed as: "), - crayon_key("Installed"), - crayon_body(" | "), - crayon_key("Available"), - crayon_body(".")) - functions_check <- cli::rule(left = "Available functions", width = nchar("Available functions") + 6) @@ -1079,7 +718,7 @@ package_report <- function(startup = FALSE, functions_tip3 <- paste0(cli::style_bold(cli::col_cyan(cli::symbol$info)), crayon_body(" Check the package requirements function-wise with: "), - cli::style_italic(crayon_key('SCpubr::check_dependencies()'))) + cli::style_italic(crayon_key('SCpubr:::return_dependencies()'))) } tip_rule <- cli::rule(left = "Tips!", width = nchar("Tips!") + 6) @@ -1108,15 +747,10 @@ package_report <- function(startup = FALSE, stars, "\n", "\n", updates, "\n", "\n", plotting, "\n", "\n", "\n", "\n", - updates_check, "\n", "\n", - cran_version_message, "\n", - system_version_message, "\n", "\n", - veredict_message, "\n", "\n", "\n", "\n", packages_check, "\n", "\n", paste(print.list, collapse = "\n"), "\n", "\n", packages_tip1, "\n", - packages_tip2, "\n", - packages_tip3, "\n", "\n", "\n", "\n", + packages_tip2, "\n", "\n", "\n", "\n", functions_check, "\n", "\n", paste(print.list.functions, collapse = "\n"), "\n", "\n", functions_tip1, "\n", @@ -1145,15 +779,10 @@ package_report <- function(startup = FALSE, if (isTRUE(extended)){ msg_wrap <- paste0("\n", "\n", header, "\n", "\n", - updates_check, "\n", "\n", - cran_version_message, "\n", - system_version_message, "\n", "\n", - veredict_message, "\n", "\n", "\n", "\n", packages_check, "\n", "\n", paste(print.list, collapse = "\n"), "\n", "\n", packages_tip1, "\n", - packages_tip2, "\n", - packages_tip3, "\n", "\n", "\n", "\n", + packages_tip2, "\n", "\n", "\n", "\n", functions_check, "\n", "\n", paste(print.list.functions, collapse = "\n"), "\n", "\n", functions_tip1, "\n", diff --git a/man/check_dependencies.Rd b/man/check_dependencies.Rd deleted file mode 100644 index 97ed853..0000000 --- a/man/check_dependencies.Rd +++ /dev/null @@ -1,37 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/utils.R -\name{check_dependencies} -\alias{check_dependencies} -\title{Check SCpubr current function dependencies.} -\usage{ -check_dependencies( - function_name = NULL, - return_dependencies = FALSE, - bioconductor_repo = "https://bioconductor.org/packages/release/bioc", - cran_repo = "http://cran.us.r-project.org" -) -} -\arguments{ -\item{function_name}{\strong{\code{\link[base]{character}}} | Name of an exported function from SCpubr. If NULL, return all functions.} - -\item{return_dependencies}{\strong{\code{\link[base]{logical}}} | Whether to have the dependencies as an output object instead of a printed message.} - -\item{bioconductor_repo}{\strong{\code{\link[base]{bioconductor_repo}}} | Link to the repository that should be used to check \strong{\code{Bioconductor}} packages.} - -\item{cran_repo}{\strong{\code{\link[base]{cran_repo}}} | Link to the repository that should be used to check \strong{\code{CRAN}} packages.} -} -\value{ -None -} -\description{ -Check SCpubr current function dependencies. -} -\examples{ -\donttest{ -# See all dependencies. -SCpubr::check_dependencies() - -# See the dependencies for a single package. -SCpubr::check_dependencies(function_name = "do_DimPlot") -} -} diff --git a/man/package_report.Rd b/man/package_report.Rd index 898516f..f2d99e6 100644 --- a/man/package_report.Rd +++ b/man/package_report.Rd @@ -4,21 +4,16 @@ \alias{package_report} \title{Generate a status report of SCpubr and its dependencies.} \usage{ -package_report( - startup = FALSE, - extended = FALSE, - bioconductor_repo = "https://bioconductor.org/packages/release/bioc", - cran_repo = "http://cran.us.r-project.org" -) +package_report(startup = FALSE, extended = FALSE) } \arguments{ \item{startup}{\strong{\code{\link[base]{logical}}} | Whether the message should be displayed at startup, therefore, also containing welcoming messages and tips. If \strong{\code{FALSE}}, only the report itself will be printed.} \item{extended}{\strong{\code{\link[base]{logical}}} | Whether the message should also include installed packages, current and available version, and which \strong{\code{SCpubr}} functions can be used with the currently installed packages.} -\item{bioconductor_repo}{\strong{\code{\link[base]{bioconductor_repo}}} | Link to the repository that should be used to check \strong{\code{Bioconductor}} packages.} +\item{bioconductor_repo}{\strong{\code{\link[base]{character}}} | Link to the repository that should be used to check \strong{\code{Bioconductor}} packages.} -\item{cran_repo}{\strong{\code{\link[base]{cran_repo}}} | Link to the repository that should be used to check \strong{\code{CRAN}} packages.} +\item{cran_repo}{\strong{\code{\link[base]{character}}} | Link to the repository that should be used to check \strong{\code{CRAN}} packages.} } \value{ None @@ -30,6 +25,6 @@ This function generates a summary report of the installation status of SCpubr, w \donttest{ # Print a package report. -SCpubr::package_report() +SCpubr::package_report(startup = FALSE, extended = FALSE) } } diff --git a/tests/testthat/test-utils.R b/tests/testthat/test-utils.R index 7c0b135..b703916 100644 --- a/tests/testthat/test-utils.R +++ b/tests/testthat/test-utils.R @@ -24,26 +24,6 @@ if (base::isFALSE(dep_check[["utils"]])){ # STATE DEPENDENCIES - testthat::test_that("utils: check_dependencies - FAIL - Wrong function", { - testthat::skip_on_cran() - testthat::expect_error(SCpubr::check_dependencies("wrong_name")) - }) - - testthat::test_that("utils: check_dependencies - PASS - Correct function, one name", { - testthat::skip_on_cran() - suppressMessages({testthat::expect_message(SCpubr::check_dependencies("do_DimPlot"))}) - suppressMessages({testthat::expect_message(SCpubr::check_dependencies("do_LigandReceptorPlot"))}) - }) - - testthat::test_that("utils: check_dependencies - PASS - Correct function, several names", { - testthat::skip_on_cran() - suppressMessages({testthat::expect_message(SCpubr::check_dependencies(c("do_DimPlot", "do_FeaturePlot")))}) - }) - - testthat::test_that("utils: check_dependencies - PASS - Correct function, no parameters provided", { - testthat::skip_on_cran() - suppressMessages({testthat::expect_message(SCpubr::check_dependencies())}) - }) # PACKAGE REPORT testthat::test_that("utils: package_report - PASS - general", {