zipfplot | R Documentation |
zipfplot
generates the Zipf plot for the input data
zipfplot( x, relative.freq = TRUE, smooth.line = TRUE, smooth.conf = TRUE, conf.level = 0.99, separate.plots = FALSE, data.name = FALSE, point.size = 3, point.alpha = 0.4 )
x |
Data vector, matrix or data-frame |
relative.freq |
Logical; if |
smooth.line |
Logical; if |
smooth.conf |
Logical; if |
conf.level |
The confidence level for the confidence bands on the smoothed line |
separate.plots |
Logical; if |
data.name |
Logical; if |
point.size |
Size of the points in the plot |
point.alpha |
Alpha-transparency of the points in the plot |
The Zipf plot for a dataset shows the ranks of outcomes versus their frequency on a log-log scale. It is used to determine how closely a dataset follows "Zipf's law". The present function takes in a vector of values and produces the Zipf plot. The data input can be either a vector, a matrix or a data frame. If the input data is a vector then the output will be a Zipf plot for that data vector. If the input data is a matrix or data frame then each column will be treated as a separate variable and the output will be a single Zipf plot showing each of the variables. The user can control whether the variables are shown on a single plot or separate plots.
Zipf plot for the input data
try(zipfplot(sample(LETTERS, 300, replace = TRUE)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.