convert_cd  R Documentation 
The function fits a model to convert costdistances into Euclidean distances as implemented in Graphab software.
convert_cd( mat_euc, mat_ld, to_convert, method = "loglog", fig = TRUE, line_col = "black", pts_col = "#999999" )
mat_euc 
A symmetric 
mat_ld 
A symmetric 
to_convert 
A numeric value or numeric vector with Euclidean distances to convert into costdistances. 
method 
A character string indicating the method used to fit the model.

fig 
Logical (default = TRUE) indicating whether a figure is plotted 
line_col 
(if 'fig = TRUE') Character string indicating the color used to plot the line (default: "blue"). It must be a hexadecimal color code or a color used by default in R. 
pts_col 
(if 'fig = TRUE') Character string indicating the color used to plot the points (default: "#999999"). It must be a hexadecimal color code or a color used by default in R. 
IDs in 'mat_euc' and 'mat_ld' must be the same and refer to the same
sampling site or populations, and both matrices must be ordered
in the same way.
Matrix of Euclidean distance 'mat_euc' can be computed using the function
mat_geo_dist
.
Matrix of landscape distance 'mat_ld' can be computed using the function
mat_cost_dist
.
Before the log calculation, 0 distance values are converted into 1,
so that they are 0 after this calculation.
A list of output (converted values, estimated parameters, R2) and optionally a ggplot2 object to plot
P. Savary
foltete2012softwaregraph4lg
data("data_tuto") mat_ld < data_tuto[[2]][1:10, 1:10] * 1000 mat_euc < data_tuto[[1]][1:10, 1:10] * 50000 to_convert < c(30000, 40000) res < convert_cd(mat_euc = mat_euc, mat_ld = mat_ld, to_convert = to_convert, fig = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.