Efficient Way of Installing Packages

Hey everyone,

while learning R I came across a forum post that was very helpful for checking and installing what packages were missing for a user. The R code went like this:

packages <- c("package names"...)

# Install packages not yet installed
installed_packages <- packages %in% rownames(installed.packages())
if (any(installed_packages == FALSE)) {

# Packages loading
invisible(lapply(packages, library, character.only = TRUE))

Does anyone have any tips on how I could do this in julia?

Thanks in advance for any help!

“efficient” eh? In Julia you just press ] at REPL and type add X1, X2.... If you’re trying to share your environment, simply send them your Project.toml file (or for exact reproduction, Manifest.toml file) and (again, press ] first)

pkg> activate .
pkg> instantiate

Or I guess, the functional way would also work (didn’t try this):

using Pkg
packages = ["package A", "package B", ...]

pretty sure Pkg.add takes a vector of string already

even better