extract_isopredictions: Add the isomap prediction and sd in columns attached to the...

View source: R/isotope-maneuvers.R

extract_isopredictionsR Documentation

Add the isomap prediction and sd in columns attached to the feather isotope data frame

Description

Rasterizes the isomap predictions and standard deviation (using isomap2raster) and then extracts the values associated with each location from the raster and returns the full data frame with those values joined on in columns named iso_pred and iso_sd. It overwrites those columns with a warning if either of those columns already exists in the data.

Usage

extract_isopredictions(isoscape, birds, pred = "predkrig", sd = "stdkrig")

Arguments

isoscape

the data frame of prediction.txt from ISOMAP. The latitude column must be named "lat" and the longitude column must be named "long".

birds

data frame of the individual isotope values for the birds/feathers. Should be something like breeding_wiwa_isotopes.

pred

name of the column holding the prediction (like "predkrig") in the isoscape data frame

sd

name of the column holding the standard deviation (like "stdkrig") in the isoscape data frame

Examples

# Using the provided data from breeding Wilson's warblers and the provided
# predictions from isomap_job54152:
x <- extract_isopredictions(isoscape = isomap_job54152_prediction,
                       birds = breeding_wiwa_isotopes,
                       pred = "predkrig",
                       sd = "stdkrig")

gaiah documentation built on April 28, 2023, 1:11 a.m.