I started out with a shape file of points data. I then converted this format to ppp format to use some spatstat functions.
The code to do this is listed below:
sp_points_df_al <- rgdal::readOGR(dsn = shape_path, layer = "aland_points")
# convert the spatial points data.frame to just plain ol spatial points
sp_points_al <- as(sp_points_df_al, "SpatialPoints")
# now convert the spatial points to ppp
ppp_al <- as(sp_points_al, "ppp")
# estimate the window from the points data
wind_rr <- spatstat::ripras(ppp_al)
ppp_al_constr <- spatstat::ppp(ppp_al$x, ppp_al$y, window = wind_rr)
I then wanted to do some point-pattern analysis and so used the following spatstat function:
image <- spatstat::density.ppp(ppp_al_constr, sigma = 0.004, dimyx=c(512, 512))
I then display the image using the following:
bias_palette <- colorRampPalette(c("blue", "magenta", "red", "yellow", "white"), bias=2, space="Lab")
spatstat::plot.im(k, col=bias_palette(256), ribbon = FALSE)
What I want to do next is create a Geotiff image from the above. I want to do this as I want to overlay the tiff image on top of some vector data.
My question is:
How do I convert the image above into a Geotiff format...?