gpt4 book ai didi

memory - R XML 包中的 htmlParse() 段错误错误 : 'memory not mapped'

转载 作者:行者123 更新时间:2023-12-01 15:27:48 24 4
gpt4 key购买 nike

我正在使用 R 2.11.1 和 XML 包 3.1-0,我正在查看 R2GoogleMaps 中的一个示例当我遇到段错误时。

#library(RJSONIO)
library(R2GoogleMaps)
library(XML)
#library(RCurl)

load("b.rda") # find in the sampleDocs folder in source file of R2GoogleMaps

center = c(mean(range(b$lat)), mean(range(b$long)))
code = addOverlay(gpolyline(b))

d = googleMapsDoc(code, center, zoom = 11, dim = c(750, 700), file = "simplePolyline.html")

下面是一个容易重现的代码,它得到相同的错误:
> library(XML)
> a <- htmlParse("http://bm2.genes.nig.ac.jp/RGM2/R_current/library/XML/man/xmlTreeParse.html")
> a

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

Traceback:
1: .Call("RS_XML_dumpHTMLDoc", doc, as.integer(indent), as.character(encoding), as.logical(indent), PACKAGE = "XML")
2: saveXML(from)
3: saveXML(from)
4: asMethod(object)
5: as(x, "character")
6: cat(as(x, "character"), "\n")
7: print.XMLInternalDocument(<pointer: 0x1016363f0>)
8: print(<pointer: 0x1016363f0>)

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: 1
aborting ...

Process R segmentation fault at Sat Jul 31 22:07:02 2010

问题似乎还在于 saveXML()htmlParse()文件。

当我编写另一个使用 htmlParse() 的代码时,我不记得曾经遇到过这个问题(尽管我不记得我是否明确调用了 htmlParse() 对象)。所以我不完全确定这是否是最近的问题。当时和现在的唯一区别(我记得)是我安装了许多 OmegaHat packages从源头。

我很好奇是否有其他人收到此错误。为了探究原因是否与我的笔记本电脑有关,我已经重新启动并升级了我的操作系统作为基本步骤。可能是什么问题?谢谢。

编辑 :仅供引用:
> sessionInfo()
R version 2.11.1 (2010-05-31)
x86_64-apple-darwin9.8.0

locale:
[1] C

attached base packages:
[1] stats graphics grDevices utils datasets grid methods
[8] base

other attached packages:
[1] XML_3.1-0 digest_0.4.2 reshape_0.8.3 plyr_0.1.9 proto_0.3-8

loaded via a namespace (and not attached):
[1] ggplot2_0.8.7

最佳答案

我认为几乎按照定义,段错误构成了一个错误。
你的例子对我有用(见下文)。

我会 (a) 确保您拥有最新版本的 XML 并且错误
仍然在那里发生; (b) 联系 XML 包的维护者(尝试

maintainer("XML") ) and provide your example and the results of sessionInfo()



祝你好运。

==============

library(XML) a <- htmlParse("http://bm2.genes.nig.ac.jp/RGM2/R_current/library/XML/man/xmlTreeParse.html")

sessionInfo() R version 2.11.1 (2010-05-31) i486-pc-linux-gnu



语言环境:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=C LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

附加的基础包:
[1] stats graphics grDevices utils datasets 网格方法
[8] 基地

其他附加包:
[1] XML_3.1-0 reshape_0.8.3 plyr_1.0.3 proto_0.3-8

通过命名空间加载(未附加):
[1] ggplot2_0.8.8

关于memory - R XML 包中的 htmlParse() 段错误错误 : 'memory not mapped' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3380931/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com