Back

Explore Courses Blog Tutorials Interview Questions
+1 vote
3 views
in R Programming by (10.2k points)
edited by

How can I check for missing packages and call for installed.packages() to install them smartly?

1 Answer

0 votes
by (50.2k points)

Yes, you can easily check your package in R programming. If you are having your list of packages, compare it to the output from installed.packages()[,"Package"] and install the missing packages.

list.of.packages <- c("ggplot2", "Rcpp")

new.packages <- list.of.packages[!(list.of.packages %in% installed.packages()[,"Package"])]

if(length(new.packages)) install.packages(new.packages)

Related questions

0 votes
1 answer
+1 vote
1 answer
+1 vote
1 answer
+1 vote
1 answer

Browse Categories

...