Skip to content
Prev 360544 / 398503 Next

Could not find function "pointsToRaster"

Dear All,
Thanks for your inputs. I did replace pointsToRaster () with
raster::rasterize(). Below is part of my script.

But I got another error:
Error in (function (classes, fdef, mtable)  :
  unable to find an inherited method for function ?rasterize? for
signature ?"RasterLayer", "matrix"?

Thank you for more inputs.
Ogbos

 k<-read.table("Lat05w3.txt")
 colnames(k)<-c("y","x")
 xy<-cbind(k$x,k$y)
 library(raster)
 r<-raster()
#library(sp)
pr<-raster::rasterize(r,xy)

#pr<-pointsToRaster(r,xy)

library(maps)
w = map("world")
 wc = cbind(w$x, w$y)
 wc=wc[!is.na(wc[,1]),]
 write.table(wc, file = "my.fileb", sep=" ",row=FALSE,col=FALSE)
 my<-read.table("my.out",col.names=c("a","b"))
 rena = function(X,Z){
Y=rep(NA,length(X))
Y[!is.na(X)]=Z
Y
}
On 4/30/16, Ben Tupper <btupper at bigelow.org> wrote: