Learn R Programming

dbmss (version 1.2.4)

PlotResults: Plot of a distance-based measure against distances, with confidence envelopes

Description

Provides a plot of a function against distance, with confidence interval envelopes.

Usage

PlotResults(r, ActualValues, LocalCI, GlobalCI = NA, xlab = "r", ylab = "", 
    ReferenceValue = NA, Legend=FALSE, LegendItems=c("Value", "Local CI", "Global CI"), 
    LegendPosition="topright")

Arguments

r
A vector of distances.
ActualValues
A vector containing the values of a function (K, M,...) at several distances.
LocalCI
A list (usually obtained by KEnvelope or similar) containing: Min: A vector: the lower bound of the envelope Max: A vector: the upper bound of the envelope
GlobalCI
A list (usually obtained by GlobalEnvelope) containing: Min: A vector: the lower bound of the envelope Max: A vector: the upper bound of the envelope
xlab
The label of the X axis of the plot
ylab
The label of the Y axis of the plot
ReferenceValue
The reference value of the function. A horizontal line representing the value is drawn.
Legend
Logical; if TRUE, a legend is added to the plot.
LegendItems
A vector of strings. Describes the function and its confidence envelopes.
LegendPosition
A single keyword from the list "bottomright", "bottom", "bottomleft", "left", "topleft", "top", "topright", "right" and "center".

Value

  • NULL

Examples

Run this code
data(paracou16)
# Keep only 50% of points to run this example
X <- rthin(paracou16, 0.5)
plot(X)

# Calculate M
r <- seq(0, 30, 2)
ActualValues.X <- M.r(X, r, "V. Americana", "Q. Rosea")

# Calculate confidence envelope (should be 1000 simulations, reduced to 4 to save time)
NumberOfSimulations <- 4
Alpha <- .10
LocalEnvelope.X <- MEnvelope(NumberOfSimulations, Alpha, X, r, 
    "V. Americana", "Q. Rosea", "RandomLabeling")

# Plot
PlotResults(r, ActualValues.X, LocalEnvelope.X, ylab="M", ReferenceValue=1, 
    Legend=TRUE, LegendItems=c("M", "Local CI"))

Run the code above in your browser using DataLab