I am looking for an online console for the language R. Like I write the code and the server should execute and provide me with the output.
Similar to the website Datacamp.
While I have only had a brief look at it I think CoCalc (formerly called SageMathCloud) looks quite promising. I have recommended it to at least one person previously, and they seemed to be quite happy with it. Bayond R support you also get access to Python, SAGE (as the name indicates) and a few other things.
EDIT: Make sure to check the documentation on how to get an R (as opposed to a Python) session in a worksheet.
Yes. I believe this is what you are looking for.
You can easily have an RStudio server installed in Digital Ocean using this package: https://github.com/sckott/analogsea
RStudio Server is definately one of the options, meant exactly for this. I've thought about using it with a cloud virtual machine, but haven't had the need yet. But when I (probably) need to prepare an intro data analysis class for the fall semester, then Rstudio Server is the first option I'll be trying out.
RStudio Cloud is the best I've used.
It offers the total R-Studio experience online. Most other sandboxes from this list either didn't work, were permanently closed, or required monthly fees.
RStudio Cloud is free, but does require a login, but you can sign in with your Google account, and it saves your progress (History and such) so you can access it from any computer.
Here's a screenshot from my first project, you can see it's the same as the R-Studio you can download. I haven't tried to hit it with anything heavy yet, but I assume it's probably not as nimble as a local instance - and most likely depends on how many people are using it at the same time.