How to add R (and even RStudio as add-on) to Home Assistant?

You want to add a language to HA. What does that even mean??
Anyway, HA is opensource. There is documentation on writing add-ons or custom integrations. You can search github for things others have written as well.

Tips on Searching for Answers & Duplicate Topics in the Forum.