## S3 method for class 'data.frame':
radfit(df, ...)
## S3 method for class 'radfit.frame':
plot(x, order.by, BIC = FALSE, model, legend = TRUE,
     as.table = TRUE, ...)
## S3 method for class 'default':
radfit(x, ...)
## S3 method for class 'radfit':
plot(x, BIC = FALSE, legend = TRUE, ...)  
radlattice(x, BIC = FALSE, ...)
rad.null(x, family=poisson, ...)
rad.preempt(x, family = poisson, ...)
rad.lognormal(x, family = poisson, ...)
rad.zipf(x, family = poisson, ...)
rad.zipfbrot(x, family = poisson, ...)
## S3 method for class 'radline':
plot(x, xlab = "Rank", ylab = "Abundance", type = "b", ...)
## S3 method for class 'radline':
lines(x, ...)
## S3 method for class 'radline':
points(x, ...)
as.rad(x)
## S3 method for class 'rad':
plot(x, xlab = "Rank", ylab = "Abundance", log = "y", ...)Preemption, Lognormal, Veiled.LN,
    Zipf, Mandelbrot.xyplot).x and y axes."b" for plotting both observed points
    and fitted lines, "p" for only points, "l" for only
    fitted lines, and "n" for only setting the frame.log ="y" gives the traditional plot in community ecology
    where the pre-emption model is a straight line, and with
    log = "xy" Zipf model is a straight line. With
    rad.XXXX will return an object of class
  radline, which is constructed to resemble results of glm
  and has many (but not all) of its components, even when only
  nlm was used in fitting. At least the following
  glm methods can be applied to the result:
  fitted, residuals.glm  with alternatives
  "deviance" (default), "pearson", "response",
  function coef, AIC,
  extractAIC, and deviance.
  Function radfit applied to a vector will return
  an object of class radfit with item y for the
  constructed RAD, item family for the error distribution, and
  item models containing each radline object as an
  item. In addition, there are special AIC, coef and
  fitted implementations for radfit results. 
  When applied to a data frame
  radfit will return an object of class radfit.frame which
  is a list of radfit objects; function summary can be
  used to display the results for individual radfit objects.
  The functions are still
  preliminary, and the items in the radline objects may change.as.rad constructs observed
  RAD data.
  Functions rad.XXXX (where XXXX is a name) fit
  the individual models, and
  function radfit fits all models.  The
  argument of the function radfit can be either a vector for a
  single community or a data frame where each row represents a
  distinct community.  All these functions have their own plot
  functions. When the argument is a data frame, plot uses
  Lattice graphics, and other plot functions use
  ordinary graphics. The ordinary graphics functions return invisibly an
  ordiplot object for observed points, and function
  identify.ordiplot can be used to label selected
  species. The most complete control of graphics can be achieved
  with rad.XXXX methods which have points and lines
  functions to add observed values and fitted models into existing
  graphs.  Alternatively, radlattice uses
  Lattice graphics to display each
  radfit model in a separate panel together with their AIC or
  BIC values.  Function rad.null fits a brokenstick model where the expected
  abundance of species at rank $r$ is $a_r = (J/S) \sum_{x=r}^S
    (1/x)$ (Pielou 1975), where $J$
  is the total number of individuals (site total) and $S$ is the
  total number of species in the community.  This gives a Null model
  where the individuals are randomly distributed among observed species,
  and there are no fitted parameters. 
  Function rad.preempt fits the niche preemption model,
  a.k.a. geometric series or Motomura model, where the expected
  abundance $a$ of species at rank $r$ is $a_r = J \alpha (1 -
    \alpha)^{r-1}$. The only estimated
  parameter is the preemption coefficient $\alpha$ which gives the
  decay rate of abundance per rank.
  The niche preemption model is a straight line in a
  RAD plot. Function rad.lognormal fits a log-Normal model which
  assumes that the logarithmic abundances are distributed Normally, or
  $a_r =  \exp( \log \mu + \log \sigma N)$, where $N$ is a Normal deviate. 
  Function rad.zipf fits the Zipf model $a_r = J p_1
    r^\gamma$ where $p_1$ is the fitted
  proportion of the most abundant species, and $\gamma$ is a
  decay coefficient. The
  Zipf -- Mandelbrot 
  model (rad.zipfbrot) adds one parameter: $a_r = J c
    (r + \beta)^\gamma$ after which
  $p_1$ of the Zipf model changes into a meaningless scaling
  constant $c$. There are grand narratives about ecological
  mechanisms behind each model (Wilson 1991), but
  several alternative and contrasting mechanisms can produce
  similar models and a good fit does not imply a specific mechanism.
  Log-Normal and Zipf models are generalized linear
  models (glm) with logarithmic link function.
  Zipf-Mandelbrot adds one
  nonlinear parameter to the Zipf model, and is fitted using
  nlm for the nonlinear parameter and estimating other
  parameters and log-Likelihood with glm. Pre-emption
  model is fitted as purely nonlinear model. There are no estimated
  parameters in the Null model.  The default
  family is poisson which is appropriate only for
  genuine counts (integers), but other families that accept link =
    "log" can be used. Family Gamma may be
  appropriate for abundance data, such as cover. The ``best''
  model is selected by AIC. Therefore ``quasi'' families
  such as quasipoisson cannot be used: they do not
  have AIC nor log-Likelihood needed in non-linear
  models.
Wilson, J. B. (1991) Methods for fitting dominance/diversity curves. Journal of Vegetation Science 2, 35--46.
fisherfit and prestonfit.
  An alternative approach is to use
  qqnorm or  qqplot with any distribution.
  For controlling graphics: Lattice,
  xyplot, lset.data(BCI)
mod <- rad.lognormal(BCI[5,])
mod
plot(mod)
mod <- radfit(BCI[1,])
## Standard plot overlaid for all models
## Pre-emption model is a line
plot(mod)
## log for both axes: Zipf model is a line
plot(mod, log = "xy")
## Lattice graphics separately for each model
radlattice(mod)
# Take a subset of BCI to save time and nerves
mod <- radfit(BCI[3:5,])
mod
plot(mod, pch=".")Run the code above in your browser using DataLab