Here is an open source desktop text editor that integrates both externally defined variable definitions and R. In the following demo video, R is used shortly after the 5-minute mark:
Thoughts on the concept of integrated variables?
Download: https://github.com/DaveJarvis/scrivenvar/blob/master/README.md#download
Stay safe everyone.