tests/testclasses.R

library(grid)
library(gridSVG)

pdf(file = NULL)

pushViewport(viewport())
grid.rect()
grid.circle()
grid.text("hello, world!")
popViewport()

# All grobs and viewports should now be exported with a class attribute
# holding the value of their R class()
grid.export("test-classes.svg", addClasses = TRUE)
dev.off()

Try the gridSVG package in your browser

Any scripts or data that you put into this service are public.

gridSVG documentation built on March 31, 2023, 3:09 p.m.