I've sampled raster ASPECT data which ranges from 0-360 and now I want to group these data into directions (North, South, East, East, etc).
I found the cut function and wanted to try using that, but something seems to not be working. For my breaks, I have 10 ranges, but I keep getting the error that the length of my breaks and labels differs. It says that the length of my breaks is 20 and I'm not sure why. Any advice?
ForestType$Aspect<-cut(ForestType$Aspect,
breaks= c(c(-2,-1), c(0,22.5),c(22.51,67.5), c(67.51,112.5),c(112.51,157.5), c(157.51,202.5), c(202.51,247.5), c(247.51,292.5),c(292.51,337.5),c(337.51,360)),
labels= c("Flat", "North", "Northeast", "East","Southeast", "South", "Southwest", "West","Northwest", "North"), right=F)