The following code works great on individual rasters and gives me the information that I want:
r<-rast("LuckSpring_2001.tif")
activeCat(r)<-"Class_name"
r
f <- freq(r)
f$area <- f$count * 0.00009
f$percent = round(100 * f$area / sum(f$area), 1)
f
I'm wondering if there is a way to loop this code so I can apply it to multiple rasters and not have to do them all individually. A note that my rasters have different extents and class names.