r <- raster::raster(system.file('external/maungawhau.grd', package = 'gdistance'))
loc1 = cbind(2667670, 6479000)
loc1 = sp::SpatialPoints(loc1)
num <- seq(200, 1, length.out = 20)
feature <- create_feature_cs(raster = r, locations = loc1, x = num)
Run the code above in your browser using DataLab