R Package Import: Using library() Function
In R language, the usual way to import a package is using the library() function instead of the import() function. The library() function is used to load an already installed package so that it can be used in the current R session. For example, to import the package named dplyr, you can use the following code:
library(dplyr)
To view the list of installed packages, you can use the search() function.
search()
To import a specific function instead of the whole package, you can use the :: operator. For example, to import the mean() function, you can use the following code:
stats::mean()