How would I got about installing multiple packages in R?
I tried the following code:
install.packages("EIAdata", "gdata", "ggmap", "ggplot2","gridExtra","ISOweek","kobe","lubridate","maps","MASS","memisc","pander","plyr","psych","Quandl","quantmod","reshape2","rgeos","Rgnuplot","RODBC","scales","sp","sqldf","stockPortfolio","stringi","stringr","XLConnect", "xlsReadWrite","zipcode")
This code works:
install.packages("ggplot2")
Why won't the line with the multiple packages work?
You can install multiple packages by passing a vector of package names to the function, for example, install. packages(c("dplyr", "stringr")) . That function will install the requested packages, along with any of their non-optional dependencies.
Installing multiple packages using package. When you run the npm install command without specifying any package name, then npm will look for an existing package. json file in the current working directory. npm will install all packages listed as dependencies of the project.
If you know the name of the package you wish to install, you can install it by using this syntax: sudo apt-get install package1 package2 package3 ... You can see that it is possible to install multiple packages at one time, which is useful for acquiring all of the necessary software for a project in one step.
To pip install more than one Python package, the packages can be listed in line with the same pip install command as long as they are separated with spaces. Here we are installing both scikit-learn and the statsmodel package in one line of code. You can also upgrade multiple packages in one line of code.
Elementary: form a vector via c(...)
:
install.packages(c("EIAdata", "gdata", "ggmap", "ggplot2")) # rest omitted
so that you have one first argument of length > 1.
Personally, I prefer install.r
from littler so I'd do (at the Unix command-line):
install.r EIAdata gdata ggmap ggplot2 # rest omitted again
Note that there is no limit to the number of arguments. It was just easier for me to write this with four packages than the 20-some from your example.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With