Skip to content

Commit

Permalink
update to reflect CRAN availability
Browse files Browse the repository at this point in the history
  • Loading branch information
drammock committed Mar 6, 2015
1 parent 406a9ca commit 690c79a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="generator" content="pandoc" />
<title>Normalizing and plotting vowels with phonR 1.0-0</title>
<title>Normalizing and plotting vowels with phonR 1.0-1</title>
<style type="text/css">code{white-space: pre;}</style>
<style type="text/css">
table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {
Expand All @@ -30,9 +30,9 @@
</head>
<body>
<div id="header">
<h1 class="title">Normalizing and plotting vowels with phonR 1.0-0</h1>
<h1 class="title">Normalizing and plotting vowels with phonR 1.0-1</h1>
<h2 class="author">Daniel R. McCloy, <span class="author">University of Washington</span></h2>
<h4 class="date">Last updated 2015-03-05</h4>
<h4 class="date">Last updated 2015-03-06</h4>
</div>
<!--pandoc
s:
Expand All @@ -49,7 +49,7 @@ <h4 class="date">Last updated 2015-03-05</h4>
<h1 id="introduction">Introduction</h1>
<p>The <code>phonR</code> package provides functions for vowel formant frequency and <span class="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>
<h2 id="installation">Installation</h2>
<p><code>phonR 1.0-0</code> is not yet available through the <a href="http://cran.r-project.org/package=phonR">Comprehensive R Archive Network</a>, but the source code is hosted on <a href="https://github.com/drammock/phonR">GitHub</a> so the package can be installed using <code>devtools::install_github(&quot;drammock/phonR&quot;)</code>. <code>phonR</code> is licensed under <a href="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>
<p><code>phonR 1.0-1</code> is available through the <a href="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 <a href="https://github.com/drammock/phonR">GitHub</a> so the development version of the package can also be installed using <code>devtools::install_github(&quot;drammock/phonR&quot;)</code>. <code>phonR</code> is licensed under <a href="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>
<p>To run the examples in this tutorial yourself, you need to load <code>phonR</code> and the accompanying sample data:</p>
<pre class="sourceCode r"><code class="sourceCode r"><span class="kw">library</span>(phonR)
<span class="kw">data</span>(indoVowels) <span class="co"># provides dataframe &#39;indo&#39;</span></code></pre>
Expand Down Expand Up @@ -311,7 +311,7 @@ <h1 id="appendix-fonts-ipa-and-unicode">Appendix: Fonts, IPA, and Unicode</h1>
<h2 id="interactive-plotting-vs.-direct-to-file">Interactive plotting vs. direct-to-file</h2>
<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=&quot;screen&quot;)</code> and then saving the plot from the GUI.</p>
<h2 id="choosing-an-ipa-font">Choosing an IPA font</h2>
<p>Gone are the days when the only unicode-compliant option for IPA transcription was the <a href="http://scripts.sil.org/doulossil_download">Doulos SIL</a> typeface. The plots above use <a href="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: <a href="http://mplus-fonts.sourceforge.jp/">M+</a>, <a href="http://www.stixfonts.org/">STIX</a>, and <a href="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>
<p>Gone are the days when the only unicode-compliant option for IPA transcription was the <a href="http://scripts.sil.org/doulossil_download">Doulos SIL</a> typeface. Some of the plots above use <a href="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: <a href="http://mplus-fonts.sourceforge.jp/">M+</a>, <a href="http://www.stixfonts.org/">STIX</a>, and <a href="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>
<h2 id="working-with-unicode-ipa-glyphs-in-microsoft-windows">Working with Unicode IPA glyphs in Microsoft Windows</h2>
<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>
<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 <a href="http://notepad-plus-plus.org/">Notepad++</a>) and then read the data in <code>R</code> via <code>read.delim(..., encoding=&quot;UTF-8&quot;)</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>
Expand Down
6 changes: 3 additions & 3 deletions phonR.Rmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "Normalizing and plotting vowels with phonR 1.0-0"
title: "Normalizing and plotting vowels with phonR 1.0-1"
runningtitle: "phonR 1.0-0 vignette"
author:
- name: Daniel R. McCloy
Expand Down Expand Up @@ -31,7 +31,7 @@ options(width=90)
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.

## Installation
`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.
`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.

To run the examples in this tutorial yourself, you need to load `phonR` and the accompanying sample data:

Expand Down Expand Up @@ -268,7 +268,7 @@ It would be quite a shame to put so much effort into creating beautiful vowel pl
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.

## Choosing an IPA font
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.
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.

## Working with Unicode IPA glyphs in Microsoft Windows
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.
Expand Down

0 comments on commit 690c79a

Please sign in to comment.