Learn R Programming

phonTools (version 0.1-6)

vowelplot: Plot Vowels

Description

A flexible function which can be used to create a wide variety of vowel plots.

Usage

vowelplot(f1s, f2s, labels = 0, xrange = NULL, yrange = NULL, meansOnly = FALSE,
ellipses = FALSE, ellipsesd = 1.96, add = FALSE, pointType = 0,
colors = NULL, logaxes = "", grid = FALSE, gridInterval = c(200, 500), 
gridStart = c(0, 0), defaultPlot = TRUE, alternateAxes = FALSE, ...)

Arguments

f1s
A numeric vector indicating vowel F1 frequencies.
f2s
A numeric vector indicating vowel F1 frequencies.
labels
A vector with labels for vowels. Must be provided for any category-dependent differences in plotting.
xrange
Allows the user to set the x axis range for the plot.
yrange
Allows the user to set the y axis range for the plot.
meansOnly
If TRUE, only category means are plotted (labels must be provided).
ellipses
If TRUE, standard deviation ellipses are drawn (one per category as indicated by label vector).
ellipsesd
A number indicating the number of standard deviations ellipses will enclose.
add
If TRUE, vowels are plotted on existing figure. If FALSE, a new one is created.
pointType
Kinds of points to use determined by 'pch' value. If specified it overrides text labels. It cycles through the list given if number of point types are less than number of categories.
colors
Colors to use for different categories. If specified this overrides automatic colors. It cycles through the list given if number of colors are less than number of categories.
logaxes
Linear axes are used by default. For log axes set to 'xy'.
grid
If TRUE, a grid is drawn on the plot.
gridInterval
A 2-tuple. Determines the spacing between grid lines. The first number determines the x-axis spacing, the second determines the y-axis spacing.
gridStart
A 2-tuple. Determines where the grid lines begin. The first number determines x-axis start, the second determines the y-axis start.
defaultPlot
If TRUE, the function plots using pre-determined values. If FALSE, the user has almost complete control over the internal call of 'plot'.
alternateAxes
If TRUE, F1 is plotted on the y axis and F2 on the x axis with the origin in the top right corner. By default F1 is plotted on the x axis and F2 on the y axis with the origin in the bottom left corner.
...
Additional arguments are passed to the internal call of 'plot'.

Examples

Run this code
data (pb52)

## the top row of the figure created with the following code highlights differences
## in general layout. The bottom row highlights differences in presentation of data points
## these plots represent only a subset of possible configurations
par (mfrow = c(2,4), mar = c(4.2,4.2,1,1))

## standard layout with linear axes
vowelplot (pb52$f1, pb52$f2, pb52$vowel)

## standard layout with log axes
vowelplot (pb52$f1, pb52$f2, pb52$vowel, logaxes = 'xy')

## alternate layout with log axes
vowelplot (pb52$f1, pb52$f2, pb52$vowel, logaxes = 'xy', alternateAxes = TRUE)

## standard layout with log axes and grid lines
vowelplot (pb52$f1, pb52$f2, pb52$vowel, logaxes = 'xy', grid = TRUE)

## points rather than text labels for vowels
vowelplot (pb52$f1, pb52$f2, pb52$vowel, logaxes = 'xy', pointType = 16)

## points with standard deviation ellipses
vowelplot (pb52$f1, pb52$f2, pb52$vowel, logaxes = 'xy', pointType = 16,
           ellipses = TRUE)

## category means only 
vowelplot (pb52$f1, pb52$f2, pb52$vowel, logaxes = 'xy', meansOnly = TRUE)

## category means only with standard deviation ellipses
vowelplot (pb52$f1, pb52$f2, pb52$vowel, logaxes = 'xy', meansOnly = TRUE,
           ellipses = TRUE)

Run the code above in your browser using DataLab