You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>The <code>phonR</code> package provides functions for vowel formant frequency and <spanclass="math">\(f_0\)</span> normalization, as well as a vowel plotting function <code>plotVowels</code> with many advanced features. There are also a few functions for calculating the area of the vowel space (either as a convex polygonal hull or a polygon connecting the mean values of the vowels), and for calculating the repulsive force of the vowel system. <code>phonR</code> also includes sample data in the form of F1 and F2 measurements for eight speakers of Standard Indonesian.</p>
51
51
<h2id="installation">Installation</h2>
52
-
<p><code>phonR 1.0-0</code> is not yet available through the <ahref="http://cran.r-project.org/package=phonR">Comprehensive R Archive Network</a>, but the source code is hosted on <ahref="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/drammock/phonR">GitHub</a> so the package can be installed using <code>devtools::install_github("drammock/phonR")</code>. <code>phonR</code> is licensed under <ahref="http://www.gnu.org/licenses/gpl.html">GPL-3</a>, and has three dependencies: <code>deldir</code> (for Delaunay triangulations), <code>plotrix</code> (for creating color scales), and <code>splancs</code> (for point-in-polygon functions). Plotting vowels with non-ASCII characters (i.e., most vowel symbols in the IPA) also requires that the user’s computer have a typeface installed that contains glyphs at the necessary codepoints, and that the user specify that typeface when calling the <code>plotVowels</code> function.</p>
52
+
<p><code>phonR 1.0-1</code> is available through the <ahref="http://cran.r-project.org/package=phonR">Comprehensive R Archive Network</a> and can be installed from within <code>R</code> using <code>install.packages('phonR')</code>. The source code is hosted on <ahref="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/drammock/phonR">GitHub</a> so the development version of the package can also be installed using <code>devtools::install_github("drammock/phonR")</code>. <code>phonR</code> is licensed under <ahref="http://www.gnu.org/licenses/gpl.html">GPL-3</a>, and has three dependencies: <code>deldir</code> (for Delaunay triangulations), <code>plotrix</code> (for creating color scales), and <code>splancs</code> (for point-in-polygon functions). Plotting vowels with non-ASCII characters (i.e., most vowel symbols in the IPA) also requires that the user’s computer have a typeface installed that contains glyphs at the necessary codepoints, and that the user specify that typeface when calling the <code>plotVowels</code> function.</p>
53
53
<p>To run the examples in this tutorial yourself, you need to load <code>phonR</code> and the accompanying sample data:</p>
@@ -311,7 +311,7 @@ <h1 id="appendix-fonts-ipa-and-unicode">Appendix: Fonts, IPA, and Unicode</h1>
311
311
<h2id="interactive-plotting-vs.-direct-to-file">Interactive plotting vs. direct-to-file</h2>
312
312
<p>Many R front-ends provide a GUI for capturing generated plots and saving them in different file formats. In many cases this works seamlessly, but in other cases it has been the case that custom fonts specified with the <code>family</code> argument are properly displayed on screen, but not when the plot window contents are saved to file. It is strongly recommended that you use <code>phonR</code>’s built-in capability to save direct-to-file when you want file output, rather than using <code>plotVowels(..., output="screen")</code> and then saving the plot from the GUI.</p>
313
313
<h2id="choosing-an-ipa-font">Choosing an IPA font</h2>
314
-
<p>Gone are the days when the only unicode-compliant option for IPA transcription was the <ahref="http://scripts.sil.org/doulossil_download">Doulos SIL</a> typeface. The plots above use <ahref="http://scripts.sil.org/charissil_download">Charis SIL</a>, which (unlike Doulos SIL) has bold, italic, and bold-italic faces in addition to regular. In my experience Charis SIL aligns diacritics better than any of its competitors, but the following three fonts also have sufficiently respectable coverage of IPA codepoints to be usable in most documents concerning phonetics or phonology: <ahref="http://mplus-fonts.sourceforge.jp/">M+</a>, <ahref="http://www.stixfonts.org/">STIX</a>, and <ahref="http://www.linuxlibertine.org/">Linux Libertine O</a> (despite its name, Linux Libertine O will work on any operating system, not just Linux). All of these typefaces are free; M+ comes in an impressive range of weights and has both proportional and monospaced variants, and is the best sans-serif typeface I have found for rendering IPA glyphs.</p>
314
+
<p>Gone are the days when the only unicode-compliant option for IPA transcription was the <ahref="http://scripts.sil.org/doulossil_download">Doulos SIL</a> typeface. Some of the plots above use <ahref="http://scripts.sil.org/charissil_download">Charis SIL</a>, which (unlike Doulos SIL) has bold, italic, and bold-italic faces in addition to regular. In my experience Charis SIL aligns diacritics better than any of its competitors, but the following three fonts also have sufficiently respectable coverage of IPA codepoints to be usable in most documents concerning phonetics or phonology: <ahref="http://mplus-fonts.sourceforge.jp/">M+</a>, <ahref="http://www.stixfonts.org/">STIX</a>, and <ahref="http://www.linuxlibertine.org/">Linux Libertine O</a> (despite its name, Linux Libertine O will work on any operating system, not just Linux). All of these typefaces are free; M+ comes in an impressive range of weights and has both proportional and monospaced variants, and is the best sans-serif typeface I have found for rendering IPA glyphs.</p>
315
315
<h2id="working-with-unicode-ipa-glyphs-in-microsoft-windows">Working with Unicode IPA glyphs in Microsoft Windows</h2>
316
316
<p>Perhaps the easiest way to have a pleasant experience working with Unicode-compliant representations of IPA glyphs is to use a computer running a Linux operating system: <code>R</code> on Linux defaults to a UTF-8 locale, which means that non-ASCII glyphs can be displayed in the <code>R</code> command console (both in commands you type/paste in, and in <code>R</code>’s output) and can be used in plots without issue. Do not bother trying to get that to work on Windows by changing <code>R</code>’s locale parameter to UTF-8 on Windows. It will not work. If you want to be able to view and type non-ASCII characters in the <code>R</code> console, use Linux.</p>
317
317
<p>If you do use Windows, here are some key pieces of information that will allow you to work with Unicode IPA glyphs in <code>R</code> more easily. First: Microsoft Excel does not output UTF-8 encoded text files. If you try to save a spreadsheet from Excel as plain CSV, all the non-ASCII glyphs will be corrupted (i.e., each non-ASCII codepoint will be converted to a <code>?</code> character). If you export from Excel as “Unicode text”, what you get is tab-separated values encoded in “UCS2-LE” format (AKA, “UTF-16 little-endian with BOM”). The easiest route to opening this in <code>R</code> is to first convert it to UTF-8 (e.g., with the “Encoding” menu in the free text editor <ahref="http://notepad-plus-plus.org/">Notepad++</a>) and then read the data in <code>R</code> via <code>read.delim(..., encoding="UTF-8")</code>. To open “UCS-2LE” encoded files directly in <code>R</code> is a complicated process, but can be done; it involves reading in the file as raw text, splitting each line on the tab characters, collapsing the resulting list into a matrix using <code>rbind</code>, converting to a data frame, and finally manually converting any columns containing numeric or logical data to the proper mode. A sample of this method is given below:</p>
Copy file name to clipboardExpand all lines: phonR.Rmd
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: "Normalizing and plotting vowels with phonR 1.0-0"
2
+
title: "Normalizing and plotting vowels with phonR 1.0-1"
3
3
runningtitle: "phonR 1.0-0 vignette"
4
4
author:
5
5
- name: Daniel R. McCloy
@@ -31,7 +31,7 @@ options(width=90)
31
31
The `phonR` package provides functions for vowel formant frequency and $f_0$ normalization, as well as a vowel plotting function `plotVowels` with many advanced features. There are also a few functions for calculating the area of the vowel space (either as a convex polygonal hull or a polygon connecting the mean values of the vowels), and for calculating the repulsive force of the vowel system. `phonR` also includes sample data in the form of F1 and F2 measurements for eight speakers of Standard Indonesian.
32
32
33
33
## Installation
34
-
`phonR 1.0-0` is not yet available through the [Comprehensive R Archive Network](http://cran.r-project.org/package=phonR), but the source code is hosted on [GitHub](https://github.com/drammock/phonR) so the package can be installed using `devtools::install_github("drammock/phonR")`. `phonR` is licensed under [GPL-3](http://www.gnu.org/licenses/gpl.html), and has three dependencies: `deldir` (for Delaunay triangulations), `plotrix` (for creating color scales), and `splancs` (for point-in-polygon functions). Plotting vowels with non-ASCII characters (i.e., most vowel symbols in the IPA) also requires that the user’s computer have a typeface installed that contains glyphs at the necessary codepoints, and that the user specify that typeface when calling the `plotVowels` function.
34
+
`phonR 1.0-1` is available through the [Comprehensive R Archive Network](http://cran.r-project.org/package=phonR) and can be installed from within `R` using `install.packages('phonR')`. The source code is hosted on [GitHub](https://github.com/drammock/phonR) so the development version of the package can also be installed using `devtools::install_github("drammock/phonR")`. `phonR` is licensed under [GPL-3](http://www.gnu.org/licenses/gpl.html), and has three dependencies: `deldir` (for Delaunay triangulations), `plotrix` (for creating color scales), and `splancs` (for point-in-polygon functions). Plotting vowels with non-ASCII characters (i.e., most vowel symbols in the IPA) also requires that the user’s computer have a typeface installed that contains glyphs at the necessary codepoints, and that the user specify that typeface when calling the `plotVowels` function.
35
35
36
36
To run the examples in this tutorial yourself, you need to load `phonR` and the accompanying sample data:
37
37
@@ -268,7 +268,7 @@ It would be quite a shame to put so much effort into creating beautiful vowel pl
268
268
Many R front-ends provide a GUI for capturing generated plots and saving them in different file formats. In many cases this works seamlessly, but in other cases it has been the case that custom fonts specified with the `family` argument are properly displayed on screen, but not when the plot window contents are saved to file. It is strongly recommended that you use `phonR`’s built-in capability to save direct-to-file when you want file output, rather than using `plotVowels(..., output="screen")` and then saving the plot from the GUI.
269
269
270
270
## Choosing an IPA font
271
-
Gone are the days when the only unicode-compliant option for IPA transcription was the [Doulos SIL](http://scripts.sil.org/doulossil_download) typeface. The plots above use [Charis SIL](http://scripts.sil.org/charissil_download), which (unlike Doulos SIL) has bold, italic, and bold-italic faces in addition to regular. In my experience Charis SIL aligns diacritics better than any of its competitors, but the following three fonts also have sufficiently respectable coverage of IPA codepoints to be usable in most documents concerning phonetics or phonology: [M+](http://mplus-fonts.sourceforge.jp/), [STIX](http://www.stixfonts.org/), and [Linux Libertine O](http://www.linuxlibertine.org/) (despite its name, Linux Libertine O will work on any operating system, not just Linux). All of these typefaces are free; M+ comes in an impressive range of weights and has both proportional and monospaced variants, and is the best sans-serif typeface I have found for rendering IPA glyphs.
271
+
Gone are the days when the only unicode-compliant option for IPA transcription was the [Doulos SIL](http://scripts.sil.org/doulossil_download) typeface. Some of the plots above use [Charis SIL](http://scripts.sil.org/charissil_download), which (unlike Doulos SIL) has bold, italic, and bold-italic faces in addition to regular. In my experience Charis SIL aligns diacritics better than any of its competitors, but the following three fonts also have sufficiently respectable coverage of IPA codepoints to be usable in most documents concerning phonetics or phonology: [M+](http://mplus-fonts.sourceforge.jp/), [STIX](http://www.stixfonts.org/), and [Linux Libertine O](http://www.linuxlibertine.org/) (despite its name, Linux Libertine O will work on any operating system, not just Linux). All of these typefaces are free; M+ comes in an impressive range of weights and has both proportional and monospaced variants, and is the best sans-serif typeface I have found for rendering IPA glyphs.
272
272
273
273
## Working with Unicode IPA glyphs in Microsoft Windows
274
274
Perhaps the easiest way to have a pleasant experience working with Unicode-compliant representations of IPA glyphs is to use a computer running a Linux operating system: `R` on Linux defaults to a UTF-8 locale, which means that non-ASCII glyphs can be displayed in the `R` command console (both in commands you type/paste in, and in `R`’s output) and can be used in plots without issue. Do not bother trying to get that to work on Windows by changing `R`’s locale parameter to UTF-8 on Windows. It will not work. If you want to be able to view and type non-ASCII characters in the `R` console, use Linux.
0 commit comments