This function takes results from jackknife() and uses linear models to calculate R-squared values for each genetic axis for each combination of the parameters num_tested and popmod. In other words, lm(known ancestry coefficients across sampling locations) ~ (predicted ancestry coefficients across sampling locations for a parameter combination). Results of the linear models can be visualized per axis or averaged across axes (default).
Arguments
- input_locs
An R object (rows = total # empirical sites, columns = total # genetic axes + 3) with column 1: site name; column 2: decimal longitude; column 3: decimal latitude; column 4…column x: ancestry coefficients for genetic axis 1…genetic axis x. Function depends on this precise format – see example data hija_struc.
- jackknife_data
An R object resulting from executing function jackknife(). The matrix has the columns: num_tested parameter; popmod parameter; estimated ancestry coefficient axis 1...estimated ancestry coefficient axis x; empirical ancestry coefficient axis 1...empirical ancestry coefficient axis x.
- axis
An integer indicating which genetic axis to visualize R2 values as a heatmap for all parameter combinations. The default value averages R2 values across all axes for visualization.
References
Massatti R & Winkler DE. (2022) Spatially explicit management of genetic diversity using ancestry probability surfaces. Methods in Ecology and Evolution. http://dx.doi.org/10.1111/2041-210X.13902
Examples
if (FALSE) { # \dontrun{
ex_raster <- raster::aggregate(hija_raster,fact=16) #Cells in embedded raster are aggregated to reduce computation time
jack_data <- jackknife(input_raster=ex_raster,input_locs=hija_struc,surface="G")
jackknife_viz(input_locs=hija_struc, jackknife_data=jack_data,axis=0)
} # }