Hi!
If you have a Spatial Points Data Frame, you can use the following function
to create a grid:
create1 <- function(obj) {
# Function that creates a new_data object if one is missing
convex_hull = chull(coordinates(obj)[,1],coordinates(obj)[,2])
convex_hull = c(convex_hull, convex_hull[1]) # Close the polygon
d = Polygon(coordinates(obj)[convex_hull, ])
new_data = spsample(d, 20, type = "regular")
gridded(new_data) = TRUE
return(new_data)
}
Hope this helps!
Sincerely,
Erin
Erin Hodgess, PhD
mailto: erinm.hodgess at gmail.com
On Fri, May 17, 2019 at 8:01 AM DINESHKUMAR <dineshchandrasekar.dk at
gmail.com>
wrote:
> how to create prediction grid like meuse grid
> *Thanks & Regards*
>
> *C Dineshkumar*
> *Bsc Agriculture*
> *M.Tech Remote Sensing and GIS*
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
[[alternative HTML version deleted]]