It depends on what you mean by "overimpose".

Maybe this way?

# some spatial polygon
library(maptools)
R <- as(affine(letterR, mat=diag(c(20,20))), "SpatialPolygons")
plot(R, border="blue")

# "overimpose" grids A to C on R:
plot(C, border="green", add=T)
plot(B, border="red", add=T)
plot(A, add=T)

Cheers,
Marcelino



El 10/02/2023 a las 13:29, Manuel Spínola escribió:
Thank you very much Marcelino.

And how can overimpose those grids to a spatial polygon?

Manuel

On Fri, 10 Feb 2023 at 03:09 Marcelino de la Cruz Rot <marcelino.delac...@urjc.es> wrote:

    Dear Manuel,
    This is R. There is no "it is possible". Only "how" ;-).

    For example, with spatstat.geom,

    A <- tess(xgrid=seq(0,80, by=8),ygrid=seq(0,80, by=8))
    B <- tess(xgrid=seq(0,80, by=4),ygrid=seq(0,80, by=4))
    C <- tess(xgrid=seq(0,80, by=2),ygrid=seq(0,80, by=2))
    D <- tess(xgrid=seq(0,80, by=1),ygrid=seq(0,80, by=1))

    Cheers,
    Marcelino


    El 10/02/2023 a las 0:21, Manuel Spínola escribió:
    > Dear list members,
    >
    > Is it possible to generate a spatial nested grid in R?
    >
    > For example, a grid of several 8km x 8km tiles, and within that
    grid, I
    > want 4 tiles of 4km x 4km, and in each of those I want 4 tiles
    of 2km x
    > 2km, and in each of those I want 4 tiles of 1km x 1km.
    >
    > Manuel
    >

-- Marcelino de la Cruz Rot
    Coordinador funcional de Biología
    Depto. de Biología y Geología
    Física y Química Inorgánica
    Universidad Rey Juan Carlos
    Móstoles España

    _______________________________________________
    R-sig-Geo mailing list
    R-sig-Geo@r-project.org
    https://stat.ethz.ch/mailman/listinfo/r-sig-geo

--
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspin...@una.cr <mailto:mspin...@una.ac.cr>
mspinol...@gmail.com
Teléfono: (506) 8706 - 4662
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/index.php/manuel>
Blog sobre Ciencia de Datos: https://mspinola-ciencia-de-datos.netlify.app


--
Marcelino de la Cruz Rot
Coordinador funcional de Biología
Depto. de Biología y Geología
Física y Química Inorgánica
Universidad Rey Juan Carlos
Móstoles España

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Reply via email to