Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use different method of accessing CairoPNG

R CMD check didn't like Cairo::CairoPNG. With this method, check wants
Cairo to be imported in NAMESPACE, but it shouldn't be - Cairo should
be optional.
  • Loading branch information...
commit 6fcacd5159f99fc0c81c44025cec6b50e382b904 1 parent 11b39cb
@wch wch authored
Showing with 8 additions and 5 deletions.
  1. +2 −1  DESCRIPTION
  2. +6 −4 R/shinywrappers.R
View
3  DESCRIPTION
@@ -24,7 +24,8 @@ Imports:
xtable,
digest
Suggests:
- markdown
+ markdown,
+ Cairo
URL: https://github.com/rstudio/shiny, http://rstudio.github.com/shiny/tutorial
BugReports: https://github.com/rstudio/shiny/issues
Collate:
View
10 R/shinywrappers.R
@@ -63,12 +63,14 @@ reactivePlot <- function(func, width='auto', height='auto', ...) {
# If quartz is available, use png() (which will default to quartz).
# Otherwise, if the Cairo package is installed, use CairoPNG().
# Finally, if neither quartz nor Cairo, use png().
- if (capabilities("aqua"))
+ if (capabilities("aqua")) {
pngfun <- png
- else if (nchar(system.file(package = "Cairo")))
- pngfun <- Cairo::CairoPNG
- else
+ } else if (nchar(system.file(package = "Cairo"))) {
+ require(Cairo)
+ pngfun <- CairoPNG
+ } else {
pngfun <- png
+ }
do.call(pngfun, c(args, filename=png.file, width=width, height=height))
on.exit(unlink(png.file))
Please sign in to comment.
Something went wrong with that request. Please try again.