A r code execution error about fuction "text"

It looks like there's quite a bit going on there, and it's really impossible to say what's happening without knowing what you've done before typing tex.

Could you please turn this into a self-contained reprex (short for minimal reproducible example)? It will help us help you if we can be sure we're all working with/looking at the same stuff.

Here's a post about reprexes from our FAQ that should help you get started: