R IDE
DISCLAIMER
R IDE in CoCalc is the open source edition of RStudio. Posit Software, PBC is in no way associated with CoCalc.
There are a number of ways to use R in CoCalc.
Collaborative X11 Application
You can create X11 Graphical Desktop, then click R IDE in the application list at the bottom left and wait about 20 seconds. The advantage is real-time collaboration just as with any other X11 application, but the response time may be slow.
Notebook Server
Click on the Servers / Notebook Servers tab and launch R IDE :

Launching R IDE Server
Compute Server
If you need more powerful compute resources, use Compute Servers with R Statistics image. Here CoCalc’s CEO and Founder William Stein explains how to run it:
R Markdown
Open a *.Rmd
or *.rmd
file to work with R Markdown.
Depending on the configuration in the preamble, you either produce an HTML or PDF output.
Do not forget to switch the panel for the rendered output accordingly. Here is an example of R markdown producing a pdf file:

If you produce PDF and HTML output, you can see both after splitting the panel.
There is a brief tutorial on R Markdown in the Project Library. To view the sample files, do the following:
Open a project where you want the copied files to be placed.
Open the Files tab.
Click “Library” at upper right.
Select “RMarkdown in CoCalc”.
Click “Get a copy”.

Other Ways
You can also use R in CoCalc via:
Jupyter notebooks with the R kernel. See Jupyter Kernels.
Creating a file ending in .r and running it. You can keep your source file in one pane with a Linux terminal beside it to run the program. See Terminal Environment in Split Frame with File Editor.
Knitr (rnw or Rtex file).
Sage worksheet with R (sagews file and “%r” mode). See Custom “Mode Commands” in Sage Worksheets under Sage Worksheets.