[英]readPicture function (grImport package) not working on Linux (F22)
I'm trying to read an ps.xml file using grImport library ( http://cran.r-project.org/web/packages/grImport/vignettes/import.pdf ) Here is my code: 我正在尝试使用grImport库( http://cran.r-project.org/web/packages/grImport/vignettes/import.pdf )阅读ps.xml文件,这是我的代码:
require("gridBase")
require("grImport")
require("plotrix")
petal <- readPicture("petal.ps.xml")
And this is the error I'm getting: 这是我得到的错误:
Error in if (x == 0) 1 else if (x == 1) 0 else x :
missing value where TRUE/FALSE needed
Here is my session information 这是我的会议信息
> sessionInfo()
R version 3.2.0 (2015-04-16)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: Fedora 22 (Twenty Two)
locale:
[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=en_US.UTF-8 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
attached base packages:
[1] grid stats graphics grDevices utils datasets methods
[8] base
other attached packages:
[1] plotrix_3.5-12 grImport_0.9-0 XML_3.98-1.3 gridBase_0.4-7
The same code works on a Linux F20 with the following session information 相同的代码可在具有以下会话信息的Linux F20上工作
> sessionInfo()
R version 3.2.0 (2015-04-16)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: Fedora 20 (Heisenbug)
locale:
[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=en_US.UTF-8 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
attached base packages:
[1] grid stats graphics grDevices utils datasets methods
[8] base
other attached packages:
[1] plotrix_3.4-8 grImport_0.8-4 XML_3.96-1.1 gridBase_0.4-6
I struggled with the same problem and eventually solved it by regenerating the xml with PostScriptTrace
on the other platform. 我在同一个问题上苦苦挣扎,最终通过在另一个平台上使用PostScriptTrace
重新生成xml来解决了这个问题。 When comparing the files generated on the two platforms, I found that the failing image file was missing attributes in the path/context/style
element. 比较两个平台上生成的文件时,我发现失败的图像文件缺少path/context/style
元素中的属性。 I was able to manually add the missing attributes lineend
, linemitre
, and linejoin
and load the images. 我能够手动添加缺少的属性lineend
, linemitre
和linejoin
并加载图像。
I suspect that those missing elements are the source of the problem in some versions of grImport. 我怀疑这些缺少的元素是某些版本的grImport的问题根源。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.