plot.word_coverage: Plot method for word_coverage objects

Description Usage Arguments Details Author(s) Examples

View source: R/plot_word_coverage.R

Description

Plot cumulative corpus coverage fraction of a dictionary.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## S3 method for class 'word_coverage'
plot(
  x,
  include_EOS = FALSE,
  show_limit = TRUE,
  type = "l",
  xlim = c(0, length(x)),
  ylim = c(0, 1),
  xticks = seq(from = 0, to = length(x), by = length(x)/5),
  yticks = seq(from = 0, to = 1, by = 0.25),
  xlab = "Rank",
  ylab = "Covered fraction",
  title = "Cumulative corpus coverage fraction of dictionary",
  subtitle = "_default_",
  ...
)

Arguments

x

a word_coverage object.

include_EOS

length one logical. Should End-Of-Sentence tokens be considered in the computation of coverage fraction?

show_limit

length one logical. If TRUE, plots an horizontal line corresponding to the total coverage fraction.

type

what type of plot should be drawn, as detailed in ?plot.

xlim

length two numeric. Extremes of the x-range.

ylim

length two numeric. Extremes of the y-range.

xticks

numeric vector. position of the x-axis ticks.

yticks

numeric vector. position of the y-axis ticks.

xlab

length one character. The x-axis label.

ylab

length one character. The y-axis label.

title

length one character. Plot title.

subtitle

length one character. Plot subtitle; if "default", prints dictionary length and total covered fraction.

...

further arguments passed to or from other methods.

Details

This function generates nice plots of cumulative corpus coverage fractions. The x coordinate in the resulting plot is the word rank in the underlying dictionary; the y coordinate at x is the cumulative coverage fraction for rank <= x.

Author(s)

Valerio Gherardi

Examples

1
2

sbo documentation built on Dec. 6, 2020, 1:06 a.m.