0

2018-04-26 编辑:根据评论更改标题,这是 R3.5.0 的一个更广泛的问题

原来的:

我对 R 很陌生,并不了解它的所有乐趣。

我刚刚将我的工作计算机升级(结果!)到带有 java 版本 8.1 64bit 的 windows 10;r 3.5.0 和 r 工作室 1.1.447。

我的代码不再喜欢 qdap 包。它声称可以安装但不会入库。

代码:

`pkg <- c("rJava","rmarkdown", "tidyverse","ggplot2", "knitr", "tm", "RColorBrewer", "wordcloud", "qdapDictionaries","qdapRegex", "qdapTools","qdap")

new.pkg <- pkg[!(pkg %in% installed.packages())]
if (length(new.pkg)) {
  install.packages(new.pkg, repos = "http://cran.rstudio.com")
}

library(qdap)`

输出:

`Loading required package: qdapTools
Error: package or namespace load failed for ‘qdapTools’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
 there is no package called ‘data.table’
    Error: package ‘qdapTools’ could not be loaded`

谷歌搜索建议我需要修改依赖项部分,这抛出了这个

`install.packages(new.pkg, repos = "http://cran.rstudio.com", dependencies = TRUE)

also installing the dependencies ‘data.table’, ‘koRpus’, ‘lda’, ‘proxy’, ‘SnowballC’

Package which is only available in source form, and may need compilation of C/C++/Fortran:
  ‘data.table’
      These will not be installed`

任何想法(和修复!)非常感谢。对不起obvs noobie问题。

4

2 回答 2

1

我绝不是这里的专家,但今天早些时候找到了解决这个完全相同的问题的方法!

从以下链接下载并安装最新版本的 RTools: https ://cran.r-project.org/bin/windows/Rtools/ 。重新启动 R 后,运行以下代码:

install.packages("data.table")

出现错误消息时,您应该会看到一个弹出窗口,询问您是否要尝试从其源安装包。单击“是”,它应该正确安装!

于 2018-04-27T19:22:52.370 回答
0

The GitHub for data.table has directions to a daily-build windows binary of data.table https://github.com/Rdatatable/data.table/wiki/Installation following the instructions on this and installing from the zip file now works. note that a few days ago it did not. Hopefull "normal" install practices will work soon too.

于 2018-05-02T14:07:30.257 回答