I've classified lots of rasters and I'd like to write them with the symbology I've defined. 

Here is the kind of raster I'm dealing with:

```
library(raster)
library(rasterVis)
r <- raster(nrow=10, ncol=10)
r[] = 1
r[51:100] = 3
r[3:6, 1:5] = 5
r <- ratify(r)

rat <- levels(r)[[1]]
rat$landcover <- c('Pine', 'Oak', 'Meadow')
rat$class <- c('A1', 'B2', 'C3')
levels(r) <- rat
levelplot(r, col.regions=c('palegreen', 'midnightblue', 'indianred1'))

```