sometimes detritus might come in with character values. This would be caused by all missing (in which case R uses NA_character_ or by somebody typing a word (e.g. "missing" or "lots") into the detritus column.
temp solution is dropping offending cols in combine_all_detritus_values. Better might be to do so much earlier!