Dear All,
while svg() (package grDevices) can produce several files, svglite()
(package svglite) is limited to one file/page only (as documented in the
respective help page).
Is there a simple solution to make svglite() work like svg() to produce
several files?
Of course one could call svglite() before dev.off() after every plot.
best regards,
Heinz
## example
svg("Rplot%03d.svg")
plot(1)
plot(2)
plot(3)
dev.off()
## three files Rplot001.svg, Rplot002.svg, Rplot003.svg are produced
library(svglite)
svglite("Rplot-lite.svg")
plot(1)
plot(2) ## as documented: Error in plot.new() : svglite only supports
one page
svglite with multiple files
3 messages · Heinz Tuechler, Bert Gunter
Sigh... Per the posting guide (which you have read, right?): "For questions about functions in standard packages distributed with R (see the FAQ Add-on packages in R <http://cran.r-project.org/doc/FAQ/R-FAQ.html#Add-on-packages-in-R>), ask questions on R-help.If the question relates to a *contributed package* , e.g., one downloaded from CRAN, try contacting the package maintainer first. You can also use find("functionname") and packageDescription("packagename") to find this information. *Only* send such questions to R-help or R-devel if you get no reply or need further assistance. This applies to both requests for help and to bug reports. " This certainly sounds like a question for the svglite maintainer, ?maintainer, who might know about "tricks" that one could use. Though you might get lucky here -- it's just that you should not expect to. If you tried to contact the maintainer but received no response, do include that info in your post. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
On Wed, Dec 9, 2020 at 3:33 AM Heinz Tuechler <tuechler at gmx.at> wrote:
Dear All,
while svg() (package grDevices) can produce several files, svglite()
(package svglite) is limited to one file/page only (as documented in the
respective help page).
Is there a simple solution to make svglite() work like svg() to produce
several files?
Of course one could call svglite() before dev.off() after every plot.
best regards,
Heinz
## example
svg("Rplot%03d.svg")
plot(1)
plot(2)
plot(3)
dev.off()
## three files Rplot001.svg, Rplot002.svg, Rplot003.svg are produced
library(svglite)
svglite("Rplot-lite.svg")
plot(1)
plot(2) ## as documented: Error in plot.new() : svglite only supports
one page
______________________________________________ R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Dear Bert, of course I have read the posting guide, almost two decades ago, but usually I focus on reading carefully a posting before replying. To be more precise, I did *not* ask about the svglite-package, as it works as described. My question was: "Is there a simple solution to make svglite() work like svg() to produce several files?" To make it more explicit for you, I could add "using standard packages distributed with R". So maybe you or others have some ideas, how to solve that question in a convenient way. As mentioned I know complicated solutions, as e.g. call svglite() before dev.off() after every plot. best, Heinz Bert Gunter wrote/hat geschrieben on/am 09.12.2020 17:35:
Sigh... Per the posting guide (which you have read, right?): "For questions about functions in standard packages distributed with R (see the FAQ Add-on packages in R <http://cran.r-project.org/doc/FAQ/R-FAQ.html#Add-on-packages-in-R>), ask questions on R-help.If the question relates to a *contributed package* , e.g., one downloaded from CRAN, try contacting the package maintainer first. You can also use find("functionname") and packageDescription("packagename") to find this information. *Only* send such questions to R-help or R-devel if you get no reply or need further assistance. This applies to both requests for help and to bug reports. " This certainly sounds like a question for the svglite maintainer, ?maintainer, who might know about "tricks" that one could use. Though you might get lucky here -- it's just that you should not expect to. If you tried to contact the maintainer but received no response, do include that info in your post. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Wed, Dec 9, 2020 at 3:33 AM Heinz Tuechler <tuechler at gmx.at> wrote:
Dear All,
while svg() (package grDevices) can produce several files, svglite()
(package svglite) is limited to one file/page only (as documented in the
respective help page).
Is there a simple solution to make svglite() work like svg() to produce
several files?
Of course one could call svglite() before dev.off() after every plot.
best regards,
Heinz
## example
svg("Rplot%03d.svg")
plot(1)
plot(2)
plot(3)
dev.off()
## three files Rplot001.svg, Rplot002.svg, Rplot003.svg are produced
library(svglite)
svglite("Rplot-lite.svg")
plot(1)
plot(2) ## as documented: Error in plot.new() : svglite only supports
one page
______________________________________________ R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.