Here is my code for assigning many fires seasons of daily FWI values into FWI Bins for the Dynamic Fire extension.
## User must set working directory
## read in file with daily FWI values over many fires seasons, r.g. output from CFFDRS package
firewx <- read.csv("eco1fwi_withFSwDC.csv", header=TRUE)
FWI = firewx$FWI
## calculate bin lower/left values based on percentile values from Table 1 in the Dynamic Fire System v2.0.3 User Guide
bins <- quantile(FWI, c(0,.465,.765,.9,.975), names = F)
## assign all FWI values to bins
firewx$FWIBin <- findInterval(FWI, bins, rightmost.closed = FALSE, all.inside = FALSE)
## overwrite input file with dataframe that now has FWI Bins
write.table(firewx, file="eco1fwi_withFSwDC.csv", sep = ",", eol = "\r", row.names = FALSE, col.names = TRUE)