put.data {SDMTools} | R Documentation |
put.data
replaces data in raster object of class
'asc' (this and adehabitat package) at specified
locations.
Note: there is no interpolation
done here. The values given replace the values of the
raster cell the point falls into.
put.data(pts, x)
pts |
a three-column data frame or matrix with the x and y coordinates of the locations of interest and the third column being the z values to put in the ascii grid file. |
x |
a raster matrix of class 'asc' (this and the adehabitat package) |
Implements a faster version of 'join.asc' from the
adehabitat package.
NOTE: this assumes all
locations are within the extent of the raster map. Values
outside the extent will be given a value of NA.
Returns a raster matrix of class 'asc' equal in size to input 'x'.
Jeremy VanDerWal jjvanderwal@gmail.com
#create a simple object of class 'asc' tasc = as.asc(matrix(1:50,nr=50,nc=50)); print(tasc) ## Not run: image(tasc) #define some point locations points = data.frame(x=runif(25,1,50),y=runif(25,1,50),z=50) #put the new data tasc = put.data(points,tasc) #show the data ## Not run: image(tasc)