This file contains general utility functions used throughout the package.
Details
This function checks if required packages are installed using requireNamespace
to check availability without loading packages. For CRAN compliance, this function
does not automatically install packages.
Examples
# Check if packages are available
required <- c("ggplot2", "dplyr")
availability <- check_deps(required)
print(availability)
#> ggplot2 dplyr
#> TRUE TRUE
# Get suggestions for missing packages
required_with_missing <- c("ggplot2", "dplyr", "nonexistent_package")
availability <- check_deps(required_with_missing, install_missing = TRUE)
#> Missing packages detected: nonexistent_package
#> To install missing packages, run:
#> install.packages(c("nonexistent_package"))
print(availability)
#> ggplot2 dplyr nonexistent_package
#> TRUE TRUE FALSE