本文介绍了如何从源代码安装R软件包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
一个朋友通过使用R 对NYtimes进行网络爬虫.我真的很想尝试.但是,第一步是从源代码安装一个名为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"
.
- On Windows it will look something like this:
"C:\\RJSONIO_0.2-3.tar.gz"
. - On UNIX it will look like this:
"/home/blah/RJSONIO_0.2-3.tar.gz"
.
这篇关于如何从源代码安装R软件包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!