在 RStudio 中离线安装软件包 [英] Offline installation of packages in RStudio

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

问题描述

由于安全协议,我正在使用没有 http||https 连接的工作终端.我在另一台计算机上手动下载了一些软件包,并尝试使用 RStudio 安装它们.当我在 RStudio 中运行时

I am working on a terminal at work that has no http||https connection due to security protocol. I downloaded manually a few packages on another computer and am trying to install them using RStudio. When I do run in RStudio

install.packages(//filedir/package_file.zip,repos=NULL,type="source")

它无论如何都在尝试连接到在线存储库:

it is trying to connect to an online repository anyways:

>>warning in istall.packages:
>>unable to resolve 'www.stats.ox.ac.uk'

但是当我通过 RGui 并使用 utils::menuInstallLocal() 并使用弹出窗口时,它不会尝试通过服务器连接并安装我的本地文件.

but when I go through RGui and use utils:::menuInstallLocal() and use the popup window it doesn't try connecting through a server and installs my local files.

我在 RStudio 中做错了什么?

What am I doing wrong in RStudio?

我还希望能够在安装时自动为父包安装依赖项和导入.

I also want to be able to make it that the dependencies and imports install automatically for the parent package when I install it.

推荐答案

假设您的机器上有本地 zip 存档格式的包.

Assuming you have your packages in zip archive format local onto your machine.

RStudio 有一个简单的菜单选项

RStudio has a simple menu option

Tools>Install Packages > 在 Install from 选项中选择Package Archive File"

Tools>Install Packages > Select "Package Archive File" in Install from option

浏览您需要安装的包文件.

browse your package file you need to install.

安装后你可能想加载库,例如如果你已经安装了tm"包,那么你可以运行命令

Post installation you may like to load the libraries for instance if you have installed "tm" package then you may run the command

library(tm) # 加载库tm"

library(tm) # load the library "tm"

希望它有效:)

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

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