Learn R Programming

MigConnectivity (version 0.4.7)

plot.intrinsicAssign: Basic plot function for the different isoAssign outputs

Description

Generates a basic plot of the isotope assignments. If map = 'population' generates a single map. If map = 'probability' or map = 'odds' generates a map for each individual is generated. User is asked for input before each individual is drawn.

Usage

# S3 method for intrinsicAssign
plot(x, map, ...)

Value

No return value, called to generate plot(s).

Arguments

x

an isoAssign object

map

which isoAssign output to plot either 'probability', 'population' or 'odds'

...

additional arguments passed to plot function

See Also

isoAssign

Examples

Run this code
# \donttest{
  extensions <- c("shp", "shx", "dbf", "sbn", "sbx")
  tmp <- tempdir()
  for (ext in extensions) {
  download.file(paste0(
              "https://raw.githubusercontent.com/SMBC-NZP/MigConnectivity",
                     "/master/data-raw/Spatial_Layers/OVENdist.",
                     ext),
              destfile = paste0(tmp, "/OVENdist.", ext), mode = "wb")
  }
  OVENdist <- sf::st_read(paste0(tmp, "/OVENdist.shp"))
  OVENdist <- OVENdist[OVENdist$ORIGIN==2,] # only breeding
  sf::st_crs(OVENdist) <- sf::st_crs(4326)

  download.file(paste0(
    "https://raw.githubusercontent.com/SMBC-NZP/MigConnectivity",
                     "/master/data-raw/deltaDvalues.csv"),
              destfile = paste0(tmp, "/deltaDvalues.csv"))
  OVENvals <- read.csv(paste0(tmp, "/deltaDvalues.csv"))

  b <- isoAssign(isovalues = OVENvals[,2],
                 isoSTD = 12,
                 intercept = -10,
                 slope = 0.8,
                 odds = NULL,
                 restrict2Likely = TRUE,
                 nSamples = 1000,
                 sppShapefile = OVENdist,
                 assignExtent = c(-179,-60,15,89),
                 element = "Hydrogen",
                 period = "GrowingSeason") # setting for demonstration only

  plot(b, map = "population")
# }

Run the code above in your browser using DataLab