1 Answer

0 votes
by

 library() require()

Library () function gives an error message display, if the desired package cannot be loaded. Require () function is used inside function and throws a warning messages whenever a particular package is not Found

It loads the packages whether it is already loaded or not, It just checks that it is loaded, or loads it if it isn’t (use in functions that rely on a certain package). The documentation explicitly states that neither function will reload an already loaded package.

Consider a related program for the above differentiation.

if(!require(package, character.only=T, quietly=T)) {

install.packages (package)

library(package, character.only=T)

}

For multiple packages you can use

for(package in c(”, ”)) {

if(!require(package, character.only=T, quietly=T)) {

install.packages (package)

library(package, character.only=T)

}

}

Click here to read more about Loan/Mortgage
Click here to read more about Insurance

Related questions

+4 votes
asked Jul 28, 2019 in R Language by Aarav2017
0 votes
asked Feb 27, 2020 in R Language by rahuljain1
0 votes
asked Nov 14, 2019 in R Language by MBarbieri
0 votes
asked Apr 25, 2020 in DevOps by Robindeniel
0 votes
asked Feb 27, 2020 in R Language by rahuljain1
...