Description Usage Arguments Value Author(s) Examples
View source: R/plot_power_laws.R
Given a vector of discrete or continuous values, it fits a power law distribution to the data and plots the PDF in log-log scale.
1 2 | plot_pl_pdf(x, b = 2, ticks_x = 5, ticks_y = 5, xlab = "x",
ylab = "p(x)")
|
x |
numeric; A vector of discrete or continuous values. |
b |
numeric; Bins have size b^(n-1). |
ticks_x |
integer; Number of ticks in the x axis. |
ticks_y |
integer; Number of ticks in the y axis. |
xlab |
character; Label for the x axis. |
ylab |
character; Label for the y axis. |
A ggplot object with the plot.
Gregorio Alanis-Lobato galanisl@uni-mainz.de
1 2 3 | # Use log-binning to plot PDFs for the generated power law distributions
p_disc <- plot_pl_pdf(rnd_disc_pl(10000, 2, 2.3), 2)
p_cont <- plot_pl_pdf(rnd_cont_pl(10000, 2, 2.3), 2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.