Error when running a formula within a function

All I can say is that x is not in exdf. For a proper reprex, representative data is essential.

is invisible to anyone on any other system than yours. It doesn't have to be all the data or even your data. It just has to produce the same error message.