"Nice" graphs for PPT: Alternative to "rvg" package

I am trying to create nice graphs (preferably in base-r, but ggplot2 would also be okay) for a PowerPoint presentation in R. By "nice", I mean high resolution and seemingly well embedded.
I am trying to install the "rvg" package for the same and use it in conjunction with "officer" (which has been installed successfully), but I get the following error message:

<stdin>:1:10: fatal error: 'ft2build.h' file not found
#include <ft2build.h>
         ^
1 error generated.
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because freetype2 was not found. Try installing:
 * deb: libfontconfig1-dev (Debian, Ubuntu, etc)
 * rpm: fontconfig-devel (Fedora, EPEL)
 * csw: fontconfig_dev (Solaris)
 * brew: freetype (OSX)
If freetype2 is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a freetype2.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
--------------------------------------------------------------------
ERROR: configuration failed for package ‘systemfonts’
* removing ‘/Users/raghavtalwar/Library/R/3.3/library/systemfonts’
Warning in install.packages :
  installation of package ‘systemfonts’ had non-zero exit status
ERROR: dependency ‘systemfonts’ is not available for package ‘gdtools’
* removing ‘/Users/raghavtalwar/Library/R/3.3/library/gdtools’
Warning in install.packages :
  installation of package ‘gdtools’ had non-zero exit status
ERROR: dependency ‘gdtools’ is not available for package ‘rvg’
* removing ‘/Users/raghavtalwar/Library/R/3.3/library/rvg’
Warning in install.packages :
  installation of package ‘rvg’ had non-zero exit status

Consequently, even though I have given permission for R to install dependencies (such as gdtools), I cannot use this package. Is there a way I can correct the error? Or can I use another package? I'm using R version 3.3 on a Mac (OS X Yosemite).

Update: I cannot download rvg at all, despite the suggestions below, is there a good alternative?

R 3.3 is very old and likely to give you a lot of headache even if you solve this particular problem. Current version is 3.6.3, so you should consider upgrading and then trying again.

That being said, you do have a hint in your error output that suggests a way to solve a problem - install freetype with brew. This may or may not solve the actualy problem you are having, so give it a try.

1 Like

Unfortunately, cannot go beyond 3.3 on Yosemite. Thanks for your advice though, I'll install freetype.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.