如何从源代码安装 R 包? [英] How do I install an R package from source?
本文介绍了如何从源代码安装 R 包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
一位朋友给我发送了关于 用 R 抓取纽约时报.我真的很想尝试一下.但是,第一步是从源代码安装一个名为 RJSONIO 的包.
A friend sent me along this great tutorial on webscraping NYtimes with R. I would really love to try it. However, the first step is to installed a package called RJSONIO from source.
我相当了解 R,但我不知道如何从源代码安装软件包.
I know R reasonably well, but I have no idea how to install a package from source.
我运行的是 Mac OSX.
I'm running Mac OSX.
推荐答案
如果你有本地文件,那么使用 install.packages()
并设置 repos=NULL
>:
If you have the file locally, then use install.packages()
and set the repos=NULL
:
install.packages(path_to_file, repos = NULL, type="source")
其中 path_to_file
代表完整路径和文件名:
Where path_to_file
would represent the full path and file name:
- 在 Windows 上,它看起来像这样:
"C:\RJSONIO_0.2-3.tar.gz"
. - 在 UNIX 上,它看起来像这样:
"/home/blah/RJSONIO_0.2-3.tar.gz"
.
这篇关于如何从源代码安装 R 包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文