如何安装多个软件包? [英] How to install multiple packages?

查看:178
本文介绍了如何安装多个软件包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在R中安装多个软件包?

How would I got about installing multiple packages in R?

我尝试了以下代码:

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")

此代码有效:

install.packages("ggplot2")

为什么带有多个软件包的行不起作用?

Why won't the line with the multiple packages work?

推荐答案

基本:通过c(...)形成向量:

 install.packages(c("EIAdata", "gdata", "ggmap", "ggplot2")) # rest omitted

使您有一个一个长度为1以上的第一个参数.

so that you have one first argument of length > 1.

我个人更喜欢 littler 中的install.r,所以我愿意(在Unix命令行):

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

请注意,参数数量没有限制.与您示例中的20个软件包相比,我用4个软件包编写此软件包要容易得多.

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.

这篇关于如何安装多个软件包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆