Learn R Programming

cocorresp (version 0.4-1)

points.coca: Add points to a Co-CA plot

Description

Draws points on the current graphic device based on in supplied coca model object.

Usage

# S3 method for coca
points(x, display = c("sites", "species"),
       which = c("response", "predictor"), choices = c(1, 2),
       scaling = FALSE, select, ...)

Arguments

x

an object inheriting from class coca.

display

character; one of the stated choices. Indicates which scores to use to draw points.

which

character; one of the stated choices. Indicates which of the response or predictor data sets is used to select scores from.

choices

The Co-CA axes to draw points for.

scaling

logical; should species scores in a symmetric Co-CA be rescaled?

select

Items to be displayed. This can either be a logical vector which is TRUE for displayed items or a vector of indices of displayed items.

Arguments passed to other methods

Value

Returns the plotted x and y coordinates as a matrix.

Details

The visual appearance of the plotted points can be controlled by supplying appropriate graphical parameters via the argument. See par for details.

See Also

plot methods; plot.predcoca and plot.symcoca.

Examples

Run this code
# NOT RUN {
## symmetric CoCA
data(beetles)
data(plants)
     
## log transform the bettle data
beetles <- log(beetles + 1)
     
## fit the model
bp.sym <- coca(beetles ~ ., data = plants, method = "symmetric")

## draw a plot of the response scores
plot(bp.sym, type = "none")
points(bp.sym, display = "sites", col = "blue", pch = 16)
points(bp.sym, display = "species", col = "red", pch = 3, cex = 0.8)
# }

Run the code above in your browser using DataLab