Learn R Programming

poweRlaw (version 0.20.3)

conexp-class: Heavy-tailed distributions

Description

The poweRlaw package supports a number of distributions: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object] Each object inherits the discrete_distribution or the ctn_distribution class.

Arguments

Value

a reference object

docType

class

Copying objects

Distribution objects are reference classes. This means that when we copy objects, we need to use the copy method, i.e. obj$copy(). See the examples below for further details.

Examples

Run this code
##############################################################
#Load data and create distribution object                    #
##############################################################
data(moby)
m = displ$new(moby)

##############################################################
#Xmin is initially the smallest x value                      #
##############################################################
m$getXmin()
m$getPars()

##############################################################
#Set Xmin and parameter                                      #
##############################################################
m$setXmin(2)
m$setPars(2)


##############################################################
#Plot the data and fitted distribution                       #
##############################################################
plot(m)
lines(m)
##############################################################
#Copying                                                     #
##############################################################
## Shallow copy
m_cpy = m
m_cpy$setXmin(5)
m$getXmin()
## Instead
m_cpy = m$copy()

Run the code above in your browser using DataLab