Harold Nelson
11/8/2021
## Loading required package: sp
## Please note that rgdal will be retired by the end of 2023,
## plan transition to sf/stars/terra functions using GDAL and PROJ
## at your earliest convenience.
##
## rgdal: version: 1.5-27, (SVN revision 1148)
## Geospatial Data Abstraction Library extensions to R successfully loaded
## Loaded GDAL runtime: GDAL 3.2.1, released 2020/12/29
## Path to GDAL shared files: /Library/Frameworks/R.framework/Versions/4.1/Resources/library/rgdal/gdal
## GDAL binary built with GEOS: TRUE
## Loaded PROJ runtime: Rel. 7.2.1, January 1st, 2021, [PJ_VERSION: 721]
## Path to PROJ shared files: /Library/Frameworks/R.framework/Versions/4.1/Resources/library/rgdal/proj
## PROJ CDN enabled: FALSE
## Linking to sp version:1.4-5
## To mute warnings of possible GDAL/OSR exportToProj4() degradation,
## use options("rgdal_show_exportToProj4_warnings"="none") before loading sp or rgdal.
## Overwritten PROJ_LIB was /Library/Frameworks/R.framework/Versions/4.1/Resources/library/rgdal/proj
## Loading required package: lattice
##
## Attaching package: 'colorspace'
## The following object is masked from 'package:raster':
##
## RGB
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:raster':
##
## intersect, select, union
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
##
## Attaching package: 'tidyr'
## The following object is masked from 'package:raster':
##
## extract
## Linking to GEOS 3.8.1, GDAL 3.2.1, PROJ 7.2.1
## Registered S3 methods overwritten by 'stars':
## method from
## st_bbox.SpatRaster sf
## st_crs.SpatRaster sf
nlcd16 <- raster("NLCD_2016_Land_Cover_WaltonGA.tiff")
is.na(nlcd16) = 0
tm_shape(nlcd16) + tm_raster(style = "cat")
## stars object downsampled to 1067 by 937 cells. See tm_shape manual (argument raster.downsample)
nlcd16[nlcd16 < 20] = 1
nlcd16[nlcd16 > 1 & nlcd16 < 30] = 2
nlcd16[nlcd16 > 2 & nlcd16 < 40] = 3
nlcd16[nlcd16 > 3 & nlcd16 >= 40 ] = 4
tm_shape(nlcd16) + tm_raster(style = "cat",
palette = c("blue","orange","grey","green"),
labels = c("Wet","Developed","Barren","Green")) +
tm_layout(legend.outside = T)
## stars object downsampled to 1067 by 937 cells. See tm_shape manual (argument raster.downsample)