coords.plot: Scatterplot of spatial coordinates

View source: R/coords.plot.function.R

coords.plotR Documentation

Scatterplot of spatial coordinates

Description

Plot of the Cartesian coordinates of study participant with color and shape coded indication whether the variable of interest is observed at a specific location.

Usage

coords.plot(data, legend.pos = "topright")

Arguments

data

A data frame or matrix containing the x-coordinates in meters in the first column, the y-coordinates in meters in the second column, and the values of the attribute of interest in the third column. Additional columns are ignored.

legend.pos

position of the legend in the plot specified by a single keyword out of "none", "bottomright", "bottom", "bottomleft", "left", "topleft", "top", "topright". Default is "topright".

Value

The function returns a plot showing the points based on Cartesian coordinates. A black circle indicates that the variable of interest is observed at that location. A red cross flags a missing value.

Examples

## Example 1
xcoords = rnorm(10, mean = 0, sd = 20)
ycoords = rnorm(10, mean = 0, sd = 20)
value = c(22, 31, 10, NA, NA, 18, 9, NA, 1, 34)
dataset = cbind(xcoords, ycoords, value)
coords.plot(dataset)

## Example 2
coords.plot(birth)
coords.plot(birth, legend.pos = "bottomright")


EgoCor documentation built on April 4, 2025, 1:32 a.m.