您的位置:首页 > 运维架构 > Linux

【R】CentOS7下Rstudio实践初探及遇到的问题

2017-01-11 11:12 288 查看

缘起

R安装完毕后,按捺不住,肯定要写点东西玩玩。

然后顺便在使用的过程中,看看有什么坑可以踩踩,顺便记录。

实操

第一步,当然就是进入Rstudio,登录过程出现的问题可以看上一篇博文

第二步,就是导入数据了。但是导入数据的时候,报错。当然, 刚安装好肯定有各种包和环境没有,因此需要下载。但这里报错看看界面上出现

unable to access index for repository http://xxxx[/code] 
很明显,要么就是配置的http地址过期,要么就是没有配置。

因此我们查看下这个文件Rprofile.site(按照我的配置的话应该在这里/usr/local/R-3.3.2/src/gnuwin32/fixed/etc/Rprofile.site),如果找不到,请find一下。

vim /usr/local/R-3.3.2/src/gnuwin32/fixed/etc/Rprofile.site


修改其中r[“CRAN”] <-http 的内容。当然这个链接你要到官方Rstudio提供的mirror。在 下面给出的china镜像我选择的是清华大学的第二个镜像。即http://mirror.bjtu.edu.cn/cran/。将这个地址写入到site文件中即可。

第三部,重启Rstudio。

rstudio-server start
#这里还有另外两个命令可以使用:
rstudio-server restart/stop


这样当我们再点击导入csv的时候,就会自动出发下载事件进行下载了。

Installing packages into ‘/home/lekko/R/x86_64-pc-linux-gnu-library/3.3’
(as ‘lib’ is unspecified)
also installing the dependencies ‘assertthat’, ‘lazyeval’, ‘curl’, ‘tibble’, ‘hms’, ‘R6’, ‘BH’

trying URL 'http://cran.rstudio.com/src/contrib/assertthat_0.1.tar.gz'
Content type 'unknown' length 10187 bytes
==================================================
downloaded 10187 bytes

trying URL 'http://cran.rstudio.com/src/contrib/lazyeval_0.2.0.tar.gz'
Content type 'unknown' length 317272 bytes (309 KB)
==================================================
downloaded 309 KB

trying URL 'http://cran.rstudio.com/src/contrib/curl_2.3.tar.gz'
Content type 'unknown' length 400460 bytes (391 KB)
==================================================
downloaded 391 KB

trying URL 'http://cran.rstudio.com/src/contrib/tibble_1.2.tar.gz'
Content type 'unknown' length 54517 bytes (53 KB)
==================================================
downloaded 53 KB

trying URL 'http://cran.rstudio.com/src/contrib/hms_0.3.tar.gz'
Content type 'unknown' length 7271 bytes
==================================================
downloaded 7271 bytes

trying URL 'http://cran.rstudio.com/src/contrib/R6_2.2.0.tar.gz'
Content type 'unknown' length 203498 bytes (198 KB)
==================================================
downloaded 198 KB

trying URL 'http://cran.rstudio.com/src/contrib/BH_1.62.0-1.tar.gz'
Content type 'unknown' length 10181096 bytes (9.7 MB)
===========
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  centos R Rstudio 问题