Skip to content

R SVGAnnotation/XML parser fails with OS X generated SVG files #1

@skilpinen

Description

@skilpinen

Not certain if anybody has noticed following issue but I have been tracking a bug somewhere between R SVGAnnotation library - R SVG plotting device - OS X.

For example:
library(SVGAnnotation)
doc<-svgPlot(
{plot(1:10,1:10,pch=19)})

and then
ax <- getAxesLabelNodes(doc)
=> fails:
Error in tmp[i] : invalid subscript type 'list'

This is because inside getPlotRegionNodes() R ends up indexing empty list with empty list (tmp[i]).

If I repeat the same in Debian Linux it works perfectly.

I tracked this issue down to potentially being caused by difference in SVG generated in Linux and OS X. That same svgPlot() command results in different SVG files. They look same if one looks them from browser for example, but inside there are differences. Linux version contains 3 clipPath elements while OS X version contains 0

sessionInfo()
R version 2.15.1 (2012-06-22)
Platform: x86_64-apple-darwin12.0.0/x86_64 (64-bit)

locale:
[1] fi_FI.UTF-8/fi_FI.UTF-8/fi_FI.UTF-8/C/fi_FI.UTF-8/C

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

other attached packages:
[1] SVGAnnotation_0.93-1 XML_3.95-0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions