Learn R Programming

AgePopDenom (version 0.4.0)

install_suggested_packages: Package Initialization and Dependency Check

Description

This function checks for suggested packages and prompts the user to install any missing ones that are needed for full functionality.

Usage

install_suggested_packages(libname = NULL, pkgname = NULL)

Value

Returns NULL invisibly. The function's main effects are:

  • Checking for missing suggested packages

  • Displaying missing packages to user

  • Installing packages if user agrees

  • Providing feedback on installation success/failure

Arguments

libname

The library name where the package is installed (not used)

pkgname

The name of the package being loaded (not used)

Details

The function maintains a predefined list of suggested packages and checks if they are installed. For missing packages, it prompts the user for installation in interactive sessions.

The function uses 'cli' for user communication and handles errors gracefully during installation attempts. In non-interactive sessions, it skips installation and returns with a warning.