plot_pl_cdf: Plot a power law's cumulative density function (CDF)

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 CDF in log-log scale.

Usage

1
plot_pl_cdf(x, ticks_x = 5, ticks_y = 5, xlab = "x", ylab = "P(X >= x)")

Arguments

x

numeric; A vector of discrete or continuous values.

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 CDFs for the generated power law distributions
p_disc <- plot_pl_cdf(rnd_disc_pl(10000, 2, 2.3))
p_cont <- plot_pl_cdf(rnd_cont_pl(10000, 2, 2.3))

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