I am having issues with saving a ggplot generated graph after install R from source on Ubuntu 10.04.
For instance the following:
library(ggplot2)
head(diamonds)
p <- ggplot(data = diamonds, aes(x = carat, y = price, colour = cut)) + layer(geom = "point")
p <- p + layer(geom = "point")
ggsave("plot.svg")
Results in:
Saving 7 x 7 in image
Warning messages:
1: In grDevices::svg(...) : unable to load shared object
'/app/vendor/R/lib64/R/library/grDevices/libs//cairo.so':
libpng15.so.15: cannot open shared object file: No such file or directory
2: In grDevices::svg(...) : failed to load cairo DLL
cairo.so is present at: /app/vendor/R/lib64/R/library/grDevices/libs/cairo.so
libpng15.so.15 is present at: /app/vendor/libpng/lib/libpng15.so.15
Running capabilities() yields:
> capabilities()
jpeg png tiff tcltk X11 aqua http/ftp sockets
TRUE TRUE TRUE FALSE FALSE FALSE TRUE TRUE
libxml fifo cledit iconv NLS profmem cairo
TRUE TRUE TRUE TRUE TRUE FALSE TRUE
I'm at a bit of a loss as to what may be going wrong here, maybe it is something to do with the location of my libpng15.so.15 file?
libpng
is present in an environmental variableLD_LIBRARY_PATH
. If not, you may either reinstalllibpng
or create a symbolic linkln -s /path/to/libpng /usr/lib
.