无法在R Studio中加载SWIRL包

时间:2015-10-31 13:27:48

标签: r packages swirl

我在加载漩涡包时遇到以下错误

library("swirl", lib.loc="~/R/x86_64-pc-linux-gnu-library/3.2")
Error : .onAttach failed in attachNamespace() for 'swirl', details:
call: str_c(..., sep = " ")
error: lazy-load database '/home/ganesh/R/x86_64-pc-linux-gnu-library  /3.2/stringi/R/stringi.rdb' is corrupt
In addition: Warning messages:
1: In str_c(..., sep = " ") : restarting interrupted promise evaluation
2: In str_c(..., sep = " ") : internal error -3 in R_decompress1
Error: package or namespace load failed for ‘swirl’

正如您所看到的,R版本是3.2,它在Ubuntu 15.04 64位上运行。

请求帮助。

由于

内甚

1 个答案:

答案 0 :(得分:0)

Ubuntu 15.04也在这里,一切都很好:

edd@max:~$ install.r swirl          ## install.r is part of littler
trying URL 'https://cran.rstudio.com/src/contrib/swirl_2.2.21.tar.gz'
Content type 'application/x-gzip' length 51037 bytes (49 KB)
==================================================
downloaded 49 KB

* installing *source* package ‘swirl’ ...
** package ‘swirl’ successfully unpacked and MD5 sums checked
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (swirl)

The downloaded source packages are in
        ‘/tmp/downloaded_packages’
edd@max:~$ r -e 'library(swirl); cat("All OK\n")'

| Hi! I see that you have some variables saved in your workspace. To keep
| things running smoothly, I recommend you clean up before starting swirl.

| Type ls() to see a list of the variables in your workspace. Then, type
| rm(list=ls()) to clear your workspace.

| Type swirl() when you are ready to begin.

All OK
edd@max:~$

正如您所看到的,软件包在这里安装得很干净,不需要任何依赖(可能是因为我已经安装了相当数量的软件包)并且装载得很好。

我经常从命令行安装和测试,并使用littler中的install.r包装 - 如果要先安装sudo apt-get install littler,请执行$scandir = array_map('array_filter',array_map('callback',$scandir));