Look into where to include a check for NA values in training columns. Does the math allow for simply trimming the spdf index and rasterstack by column NA values? -already done, are NA values being created by coercion after this check?

does changing accCost to costDistance in the pathdistGen function improve calculation speed?

investigate gdistance behavior where it will wrap around the exterior of a raster!!

add example to costrasterGen that uses a SpatialPointsDataFrame as input. Fix non-working code below
#'#using a SpatialPointsDataFrame
#'xymat<-matrix(3,3,nrow=1,ncol=2)
#'xymat<-data.frame(xymat)
#'names(xymat)<-c("x","y")
#'xyspdf<-SpatialPointsDataFrame(xymat,data=xymat)
#'costras<-costrasterGen(xyspdf,pols,extent="points",projstr=NULL)

in errorGen:
trim mvp by complete.cases

add warning to pathdistGen about "unable to allocate memory" error
solution is to change the chunksize

use ".Machine" to specify the largest value that path distances can take


