plot_pl_pdf: Plot a power law's probability density function (PDF)

Description Usage Arguments Value Author(s) Examples

View source: R/plot_power_laws.R

Description

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.

Usage

1
2
plot_pl_pdf(x, b = 2, ticks_x = 5, ticks_y = 5, xlab = "x",
  ylab = "p(x)")

Arguments

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.

Value

A ggplot object with the plot.

Author(s)

Gregorio Alanis-Lobato galanisl@uni-mainz.de

Examples

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)

galanisl/PowerLawPlots documentation built on May 5, 2019, 12:30 p.m.