IPA Symbols in R

This post is an example of how to place IPA (International Phonetic Alphabet) in R charts. I have achieved that by using the hexadecimal values of the corresponding Unicode symbols. There may be a more direct approach, but I am unaware of one.

A plot is created as usual, but the IPA labels are stored in a separate vector:

diph.names.ipa <- c('e\u026A', 'a\u026A', '\u0254\u026A')

The hex values of IPA symbols are available here.

A sample graph created with this R script looks like this:

A sample graph showing IPA symbols drawn by plot() comand.
A sample graph showing IPA symbols drawn by plot() command.

 

If you are working with R in ESS, there is a difference in IPA representation on Windows and Linux. In Windows the characters are shown in the hex notation, at least in my case. On Linux, on the other hand, the symbols are shown as IPA, so it is much easier to work:

Screenshot of IPA in ESS on Linux
IPA symbols within a data frame object in R (ESS/Linux)

The table above is sorted and ready to be inserted into a text editor. In case you are using Word or Writer, you can copy/paste the table with a quick workaround. You need to have installed Open Office (Libre Office). Open Calc application, select the first cell and paste the table from Emacs. In options that appear, select “Space” and “Merge delimiter” in “Separated by” and confirm. Next step is to copy the table from Calc and paste it where needed:

Vowel F1 F2 F3
ɑ 891.89 1656.59 2564.01
a 700.65 1389.3 2871.73
ɛ 585.82 1909 2713.09
e 532.55 2197.79 2714.36
ɔ 493.94 1270.26 2604.23
ʊ 383.08 1240.57 2610.09
ɪ 383.48 2308.99 2719.21
ə 480.32 1680.69 2652.19

 

Published by

Romeo Mlinar

Languagebits.com Author

2 thoughts on “IPA Symbols in R”

  1. Great post! One option is to use cairo_pdf() instead of the typical pdf() function. That will work with phonetic characters.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.