Kevin Shoemaker has a tutorial on single-season occupancy models, where one of the covariates is a factor - 'Edge' or 'Interior' and the code for predicting occupancy and making a box plot based on that can be found here: https://kevintshoemaker.github.io/NRES-746/Occupancy.html. Hope this helps!