I've been given a large raster with an in-built RAT with all sorts of RGB data and classes etc etc, but it's been done a bit poorly and I would like to quickly rebuild it myself.
When i read into R and then writeRaster to GeoTiff, it's a right old mess, so i'd like to remove the RAT entirely, how is this done?
# here's a raster with RAT
require(raster)
r <- raster(ncol=10,nrow=10,xmn=0,xmx=10,ymn=0,ymx=10)
r[] <- sample(1:4,100,rep=T)
# ratify and add some attributes
r <- ratify(r)
rat <- levels(r)[[1]]
rat$letters <- LETTERS[1:4]
rat$names <- c("Tom","Tim","Jane","Jessica")
rat$vals <- c(0.265,0.456,0.037,0.756)
# set RAT
levels(r) <- rat
How do i get rid of the RAT?