PlotBoundaries: Plots map with boundaries from data dump folder or R object

View source: R/Boundary_functions.R

PlotBoundariesR Documentation

Plots map with boundaries from data dump folder or R object

Description

This function plots the results taken from the BoundaryFinder function that have been dumped in a specified folder or are stored in an array. These results are constructed from the correlation values calculated across the spatial grid and identifies which gird points are at the boundary of the provenancing region. These results then allows for the construction of compiled trait boundaries from spatial provenancing exercises.

Usage

PlotBoundaries(
  PlotValCor,
  DataDump = TRUE,
  Path = NA,
  RawCorArray = NA,
  MapLinesWd = 1,
  TileSize = 4,
  plotLong,
  plotLat,
  MapExpansion = c(0, 0),
  LatLongs,
  RefPchCol = "blue",
  RefPchSize = 1,
  BoundaryHue = c(1, 1),
  PacificCent = FALSE
)

Arguments

PlotValCor

numeric correlation value that is used to determine the most likely origin of the specimen. This value can be calculated by using the correct cross-validation method and identifying the correlation value that will correctly identify a desired percentage of specimens (e.g. 95%).

DataDump

if set to TRUE then the function uses files stored in the datadump folder as defined by PATH. If set to FALSE an array generated from the BoundaryFinder functions needs to be provided. Default is set to TRUE.

Path

the directory where boundary data files have been dumped from the BoundaryFinder function. Default is set to NA.

RawCorArray

an array of correlation values for each reference specimen where columns and rows correspond with longitude and latitude and the third dimension represents each individual reference specimen. Default is set to NA.

MapLinesWd

is a single numeric value to set the width of the map lines of landmass boundaries.

TileSize

is a single numeric value to set the size of the pixels/tiles that will form the boundary.

plotLong

is a vector of numeric values for all the Longitude values sampled in the boundary finding exercise. Unlike the LongRange argument of other functions where just the maximum and minimum values are specified, this vectors should contain all Longitude value expected. As a result, this numeric vector should match the column names of the data dump files.

plotLat

is a vector of numeric values for all the Latitude values sampled in the boundary finding exercise. Unlike the LatRange argument of other functions where just the maximum and minimum values are specified, this vectors should contain all Latitude value expected. As a result, this numeric vector should match the row names of the data dump files.

MapExpansion

is a vector of two numeric values that define an increase in plotting area of the map (but not the area for which the boundary calculations have been carried out). The first value is added to the This therefore allows the

LatLongs

a matrix of n rows by 2 columns where n is the number of reference specimens in your dataset and the columns are Latitude and Longitude values in that order. These latitude-longitude coordinates should be of the locations of the reference specimens.

RefPchCol

is the colour to be used for the reference specimen location points

RefPchSize

is a single numeric value to set the size of the points marking where reference specimens are located.

BoundaryHue

is a vector of 2 elements. The first element sets the colour hue value on a scale of 0 to 1 for a hsv function. The second value sets a transparancy level between 0 and 1, 0 being completely transparent.

PacificCent

logical determines whether the plotted map and analyses should be centred on the Pacific. Default set to FALSE.

Details

The map plotting of this function makes use of the functions of the maps package.

Citations

Original S code by Richard A. Becker, Allan R. Wilks. R version by Ray Brownrigg. Enhancements by Thomas P Minka and Alex Deckmyn. (2017). maps: Draw Geographical Maps. R package version 3.2.0. https://CRAN.R-project.org/package=maps

Author(s)

Ardern Hulme-Beaman

Examples

FteydeaThres <- IDbyDistanceDistInputCCV(LatLongs = Fteydea$Info[,2:3],
               DistDataMat = Fteydea$SongDisMat,
               Verbose = TRUE,
               ProvConfidence = .95,
               PrintProg = FALSE,
               Method = 'Spearman')
PlotBoundaries(PlotValCor = FteydeaThres$`Provenancing.Correlation.95%.Confidence`,
               DataDump = FALSE,
               RawCorArray = Fteydea$Total.Boundary$RawCorData,
               plotLong = colnames(Fteydea$Total.Boundary$RawCorData),
               plotLat = rownames(Fteydea$Total.Boundary$RawCorData),
               LatLongs = Fteydea$Info[,2:3],
               TileSize = 2.5,
               BoundaryHue = c(0.5,1))


ArdernHB/GeoOrigins documentation built on Nov. 19, 2022, 10:21 a.m.