Kategorien
Allgemein

Forum Risikomanagement

Die Website zu unserem Forum 2016 ist jetzt online: Risikomanagement mit Simulationen erfolgreich gestalten findet am 10. März 2016 in Hamburg statt.

Kategorien
Allgemein

Katzen

Kategorien
Allgemein

In der Pinakothek

Kategorien
Allgemein

Picknick im Park

Kategorien
Allgemein

Lightroomfun 7

Kategorien
Allgemein

Lightroomfun 6

Kategorien
Allgemein

Lightroomfun 5

Kategorien
Allgemein

Lightroomfun 4

Kategorien
Allgemein

Lightroomfun #3

Kategorien
Allgemein

Using Opentype (OTF) with R

R is a great tool to analyze data and build beautiful graphs. However, not ever problem has a straight forward solution. One of those problems is using OpenType fonts in graphs.

After some despair, I found this great How-To: How to use your favorite fonts in R charts. Because it explains a little more than necessary for this problem, here is my final walk-through:

Step 0:

Download Rtools. Be careful to select the correct version for your installation of R. I use R 3.1.2 and Rtools31.

Step 1:

Install the necessary packages:

library(devtools)
install_github("Rttf2pt1", "wch")
install_github("extrafont", "wch")
install_github("Rttf2pt1", "wch", "freetype") 
install_github("Rttf2pt1", "wch", "freetype2") 

Step 3:

Load the fonts:

library(extrafont)
font_import()

Look up the name of the font in the results of

fonts()

If everything worked, now you are ready to use the font for your plots:

png(filename = "out.png", width=7, height=5, units = "in", pointsize = 8, res=300, restoreConsole = TRUE, type = "cairo-png", , family="Myriad Pro light")

Photo by Het Nieuwe Instituut – Architecture Collection