ecos_plot_pie: Produces ecological pie chart representations of...

Description Usage Arguments Value Examples

View source: R/ecos_plot_pie.R

Description

Make a pie chart representation of the membership probabilities omega output from the ecos_fit model.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
ecos_plot_pie(
  omega = NULL,
  coords = NULL,
  bgmap_path = NULL,
  adjust = FALSE,
  thresh = 0.7,
  long_lim = c(-180, 180),
  lat_lim = c(-60, 90),
  coastline_lwd = 10,
  intensity = 1,
  radius = 0.5,
  color = c("dodgerblue2", "#E31A1C", "green4", "#6A3D9A", "#FF7F00", "black", "gold1",
    "skyblue2", "#FB9A99", "palegreen2", "#CAB2D6", "#FDBF6F", "gray70", "khaki2",
    "maroon", "orchid1", "deeppink1", "blue1", "steelblue4", "darkturquoise", "green1",
    "yellow4", "yellow3", "darkorange4", "brown", "red", "cornflowerblue", "cyan",
    "brown4", "burlywood", "darkgoldenrod1", "azure4", "green", "deepskyblue", "yellow",
    "azure1"),
  pie_control = list(),
  image_width = 1000,
  image_height = 800,
  path = "geostructure_plot.tiff"
)

Arguments

omega

Matrix of Cluster membership probabilities of each sample obtained from ecos_fit(). The row sums sum to 1 for each sample.

coords

a matrix of latitude and longitude entries for each site (row) of the omega matrix.This matrix has as many rows as the omega matrix and two columns for the latitude and longitude.

bgmap_path

The path to the shapefile to be used for plotting the map data. One can choose a shapefile of their own preference of resolution. If missing, we use a default background map - which is a coarse one.

adjust

A Boolean, indicating whether to adjust for the richness cluster. Defaults to TRUE.

thresh

a numeric value between 0 and 1 indicating the level at which to threshold the richness cluster. Sites represented by member- ship probability above this threshold of the richness cluster are removed.

long_lim

The limits for the longitude in the map plot. The default is c(-180,180) and removes Antarctica from the map.

lat_lim

The limits for the latitude in the map plot. The default is c(-60,90) and removes Antarctica from the map.

coastline_lwd

The line width for the coastline plotted in the map. Defaults to 10.

intensity

The intensity of the colors for the pie chart representation. Lies between 0 and 1. Defaults to 1.

radius

The radius of the pie charts. Defaults to 0.5

color

the vector of colors - of same size or more than the number of clusters. If missing, we use a default set of colors- chosen so that they are distinct from one another.

pie_control

The list of control parameters to be passed into the add.pie function of the package maptools.

image_width

The width of the image output. Defaults to 1000.

image_height

The height of the image output. Defaults to 800.

path

The path where the output image is saved.

Value

Returns a pie chart representation of the memberships obtained from ecos_fit on a global species presence-absence/counts data

Examples

1
2
3
4
5
6
7
8
 data("australia_birds")
 data("australia_model")
 ecos_plot_pie(omega = australia_model$omega,
                     coords = australia_birds$latlong, 
                     long_lim = c(110,160),
                     lat_lim = c(-50,-10),
                     color= c("orange", "red", "yellow", "deepskyblue", 
                              "chartreuse", "blue"))

kkdey/ecostructure documentation built on Jan. 26, 2021, 4:10 p.m.