You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been using the MK_dPCIIC function to estimate connectivity.
I am trying to use least cost distance but I keep getting the following error:
"Error in cost_distances(x = nodes, id = id, LCD = if (type == "least-cost") { :
trying to get slot "crs" from an object of a basic class ("character") with no slots"
Hi!
I have been using the MK_dPCIIC function to estimate connectivity.
I am trying to use least cost distance but I keep getting the following error:
"Error in cost_distances(x = nodes, id = id, LCD = if (type == "least-cost") { :
trying to get slot "crs" from an object of a basic class ("character") with no slots"
Here is the code I am running:
relictos = shapefile("Relictos.shp")
relictos2 = as(relictos,"sf")
resistanceR = raster("quality_out_c_Daypus_2.tif")
plot(resistanceR)
PC <- MK_dPCIIC(nodes = relictos2,attribute = NULL,
distance = list(type = "least-cost", resistance = "resistanceR"),
metric = "PC", probability = 0.05,
distance_thresholds = 1000)
Do you know why it raises this error, and how I can fix it?
Thanks in advance!
The text was updated successfully, but these errors were encountered: