# NOT RUN {
# create raster with categorical identifers
x <- raster(matrix(c(1, 2, 3, 1, NA, 1), nrow = 3))
# convert to binary stack
y <- binary_stack(x)
# plot categorical raster and binary stack representation
# }
# NOT RUN {
plot(stack(x, y), main = c("x", "y[[1]]", "y[[2]]", "y[[3]]"), nr = 1)
# }
Run the code above in your browser using DataLab