Description Usage Arguments Details See Also Examples
Plot a word frequency spectrum, or a comparison of several word frequency spectra, either as a side-by-side barplot or as points and lines on various logarithmic scales.
1 2 3 4 5 6 7 8 9 |
x, y, ... |
one or more objects of class |
m.max |
number of frequency classes that will be shown in plot. The default is 15 on linear scale and 50 when using any type of logarithmic scale. |
log |
a character string specifying the axis or axes for which
logarithmic scale is to be used ( |
conf.level |
confidence level for confidence intervals in
logarithmic plots (see "Details" below). The default value of
.95 produces 95%-confidence intervals. Set to |
bw |
if |
points |
if |
xlim, ylim |
visible range on x- and y-axis. The default values are automatically determined to fit the selected data in the plot. |
xlab, ylab |
labels for the x-axis and y-axis. The default values nicely typeset mathematical expressions. The y-axis label also distinguishes between observed and expected frequency spectra. |
main |
a character string or expression specifying a main title for the plot |
legend |
optional vector of character strings or expressions,
specifying labels for a legend box, which will be drawn in the upper
right-hand corner of the screen. If |
barcol, pch, lty, lwd, col |
style vectors that can be used to
override the global styles defined by |
By default, the frequency spectrum or spectra are represented as a
barplot, with both axes using linear scale. If the log
parameter is given, the spectra are shown either as lines in different
styles (points=FALSE
) or as overplotted points and lines
(point=TRUE
). The value of log
specifies which axes
should use logarithmic scale (specify log=""
for a
points-and-lines plot on linear scale).
In y-logarithmic plots, frequency classes with V_m = 0 are drawn outside the plot region (below the bottom margin) rather than skipped.
In all logarithmic plots, confidence intervals are indicated for
expected frequency spectra with variance data (by vertical lines with
T-shaped hooks at both ends). The size of the confidence intervals is
controlled by the conf.level
parameter (default: 95%). Set
conf.level=NA
in order to suppress the confidence interval
indicators.
Line and point styles, as well as bar colours in the barplot, can be
defined globally with zipfR.par
. They can be overridden
locally with the optional parameters barcol
, pch
,
lty
, lwd
and col
, but this should only be used
when absolutely necessary. In most cases, it is more advisable to
change the global settings temporarily for a sequence of plots.
The bw
parameter is used to switch between B/W and colour
modes. It can also be set globally with zipfR.par
.
spc
, lnre
, lnre.spc
,
plot.tfl
, plot.vgc
, zipfR.par
,
zipfR.plotutils
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | ## load Italian ultra- prefix data
data(ItaUltra.spc)
## plot spectrum
plot(ItaUltra.spc)
## logarithmic scale for m (more elements are plotted)
plot(ItaUltra.spc, log="x")
## just lines
plot(ItaUltra.spc, log="x", points=FALSE)
## just the first five elements, then the first 100
plot(ItaUltra.spc, m.max=5)
plot(ItaUltra.spc, m.max=100, log="x")
## compute zm model and expeccted spectrum
zm <- lnre("zm", ItaUltra.spc)
zm.spc <- lnre.spc(zm, N(ItaUltra.spc))
## compare observed and expected spectra (also
## in black and white to print on papers)
plot(ItaUltra.spc, zm.spc, legend=c("observed", "expected"))
plot(ItaUltra.spc, zm.spc, legend=c("observed", "expected"), bw=TRUE)
plot(ItaUltra.spc, zm.spc, legend=c("observed", "expected"), log="x")
plot(ItaUltra.spc, zm.spc, legend=c("observed", "expected"), log="x", bw=TRUE)
## re-generate expected spectrum with variances
zm.spc <- lnre.spc(zm, N(ItaUltra.spc), variances=TRUE)
## now 95% ci is shown in log plot
plot(zm.spc, log="x")
## different title and labels
plot(zm.spc, log="x", main="Expected Spectrum with Confidence Interval",
xlab="spectrum elements", ylab="expected type counts")
## can pass list of spectra in first argument with explicit call
plot.spc(Baayen2001[1:7], m.max=6, legend=names(Baayen2001)[1:7])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.