Error in rtf generation using rtf package

You are not showing the error nor does it seem obvious from your post where the error might be. On top of that, posting screenshots of your code is not very useful since it's impossible to copy-paste and run your code.

To help us help you, could you please prepare a reproducible example (reprex) illustrating your issue? Please have a look at this guide, to see how to create one: