来自tmap包的函数崩溃了我的R

时间:2017-02-08 02:04:20

标签: r geospatial tmap

以下代码crashed我的R会话。我在Jupyter Notebook的RStudio和conda R中尝试过它:

qtm(shp = countries_spdf, fill = "population")
tm_shape(countries_spdf) + tm_fill(col = "population")

您可以从以下代码中获取数据集:

download.file("http://s3.amazonaws.com/assets.datacamp.com/production/course_1816/datasets/02_countries_spdf.rds","data/02_countries_spdf.rds")
countries_spdf <- readr::read_rds("data/02_countries_spdf.rds")

错误:

  

断言失败:(0),函数查询,文件AbstractSTRtree.cpp,第285行。       中止陷阱:6

环境:

  • Mac OSX 10.10.5
  • R版本3.3.1(2016-06-21)
  • conda 4.3.9
  • jupyter notebook 4.2.3
  • RStudio版本1.0.44

1 个答案:

答案 0 :(得分:0)

也许没有关系,但我甚至无法加载当前版本的tmap和tmaptools。当我尝试时,它会崩溃R.

> library(tmap)

 *** caught segfault ***
address 0x18, cause 'memory not mapped'

Traceback:
 1: dyn.load(file, DLLpath = DLLpath, ...)
 2: library.dynam(lib, package, package.lib)
 3: loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]])
 4: asNamespace(ns)
 5: namespaceImportFrom(ns, loadNamespace(j <- i[[1L]], c(lib.loc,     .libPaths()), versionCheck = vI[[j]]), i[[2L]], from = package)
 6: loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]])
 7: asNamespace(ns)
 8: namespaceImportFrom(ns, loadNamespace(j <- i[[1L]], c(lib.loc,     .libPaths()), versionCheck = vI[[j]]), i[[2L]], from = package)
 9: loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]])
10: namespaceImport(ns, loadNamespace(i, c(lib.loc, .libPaths()),     versionCheck = vI[[i]]), from = package)
11: loadNamespace(package, lib.loc)
12: doTryCatch(return(expr), name, parentenv, handler)
13: tryCatchOne(expr, names, parentenv, handlers[[1L]])
14: tryCatchList(expr, classes, parentenv, handlers)
15: tryCatch({    attr(package, "LibPath") <- which.lib.loc    ns <- loadNamespace(package, lib.loc)    env <- attachNamespace(ns, pos = pos, deps)}, error = function(e) {    P <- if (!is.null(cc <- conditionCall(e)))         paste(" in", deparse(cc)[1L])    else ""    msg <- gettextf("package or namespace load failed for %s%s:\n %s",         sQuote(package), P, conditionMessage(e))    if (logical.return)         message(paste("Error:", msg), domain = NA)    else stop(msg, call. = FALSE, domain = NA)})
16: library(tmap)

Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace
Selection: 

我正在运行当前的Mac OS X Sierra(10.12.6)和R 3.4.1。这种情况发生在RStudio和R for Mac附带的R GUI中。