[R-sig-Geo] Error-message-when-trying-to-compute-the-least-cost-path-in-gdistance-in-R

marta azores martazores at gmail.com
Mon Nov 28 19:05:23 CET 2016


http://r-sig-geo.2731867.n2.nabble.com/Error-message-when-trying-to-compute-the-least-cost-path-in-gdistance-in-R-tt7590273.html

Hi everyone,

I have a similar problem. I have two points that I want to join in one line
"SpatialLines"

class(trCost)#"TransitionLayer"+attr gdistance
summary(trCost)#1560 x 1560 sparse Matrix of class "dsCMatrix", with 8
entries

pts1<-cbind(x=-27.54572,y=38.30128)

pts2<-cbind(x=-28.59933,y=37.32453)
#
class(pts1)#matrix
class(pts2)#matrix
#
is.numeric(pts1)#[1] TRUE

plot(shortestPath(trCost, pts[1,], pts[2,], output="SpatialLines"),
add=TRUE)
Error in if (is.numeric(v) && any(v < 0)) { :
  missing value where TRUE/FALSE needed

Thanks in advance

Marta

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list