I want to write a single df with the freq of 150 raster objects (partly answered in: Count freq of multiple raster objects in R)
I have created a list of all the raster files with
spatial.tools::list.raster.files()
and then called
lapply(ls$raster,freq)
Now I have a list containing 150 entries that contain a freq matrix for every raster file.
I am only interested in $Band.1[,"count"])
however.
For a single entry of the list I can create a df for counts with
as.data.frame(all[[1]]$Band.1[,"count"])
My question is:
How can I write $Band.1[,"count"]
for all of the 150 in the list into a single df in one go???