Closed ManuelSpinola closed 7 months ago
'id' in the dataframe is 1:10, but your values in the raster are not. So, you would rather need c(seq(0,30,10),41:43,50,60,70) instead of 1:10.
Thank you very much. I understand now.
El mar, 26 mar 2024 a las 20:59, Monika Anna Tomaszewska (< @.***>) escribió:
Id in the dataframe is 1:10, but your values in the raster are not. So, you would rather need c(seq(0,30,10),41:43,50,60,70) instead of 1:10.
— Reply to this email directly, view it on GitHub https://github.com/rspatial/terra/issues/1464#issuecomment-2021827452, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFI3FB2LQFSS6YD7N2S72GDY2IYYDAVCNFSM6AAAAABFJ2LNVOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRRHAZDONBVGI . You are receiving this because you authored the thread.Message ID: @.***>
-- Manuel Spínola, Ph.D. Instituto Internacional en Conservación y Manejo de Vida Silvestre Universidad Nacional Apartado 1350-3000 Heredia COSTA RICA @. @.> @.*** Teléfono: (506) 8706 - 4662 Sitio web institucional: ICOMVIS http://www.icomvis.una.ac.cr/index.php/manuel Sitio web personal: Sitio personal https://mspinola-sitioweb.netlify.app Blog sobre Ciencia de Datos: Blog de Ciencia de Datos https://mspinola-ciencia-de-datos.netlify.app
I cannot make a categorical raster, this is my example. I can send the file if it is necessary.
class : SpatRaster dimensions : 21230, 16881, 1 (nrow, ncol, nlyr) resolution : 0.0002694946, 0.0002694946 (x, y) extent : -87.10173, -82.55239, 5.498498, 11.21987 (xmin, xmax, ymin, ymax) coord. ref. : lon/lat WGS 84 (EPSG:4326) source : raster.tif name : b1 min value : 0 max value : 70
layer value count 1 1 0 26943 2 1 10 18721491 3 1 20 6138863 4 1 30 1244649 5 1 41 1707466 6 1 42 43817 7 1 43 1864399 8 1 50 190476 9 1 60 403085 10 1 70 27821371
class : SpatRaster dimensions : 21230, 16881, 1 (nrow, ncol, nlyr) resolution : 0.0002694946, 0.0002694946 (x, y) extent : -87.10173, -82.55239, 5.498498, 11.21987 (xmin, xmax, ymin, ymax) coord. ref. : lon/lat WGS 84 (EPSG:4326) source : raster.tif categories : cover name : cover min value : NA max value : NA