If **quanteda** provides a means to convert to dfm from dtm use that for easier maintainability: https://github.com/quanteda/quanteda/issues/1222