check_and_load_package | R Documentation |
This function checks if a specified package is installed in the R environment. If the package is not installed, it will be automatically installed. After installation (if necessary), the package is loaded into the session.
check_and_load_package(package_name)
package_name |
A string with the name of the package to check and load. |
Invisibly returns 'TRUE' if the package is successfully loaded or installed and loaded. If the installation or loading fails, an error will be raised.
check_and_load_package("httr2")
check_and_load_package("xml2")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.