R Statistical Computing Online Environment
CoCalc is an online web service where you can run R code online via your browser.
This page explains a couple of ways how to use R on CoCalc. Learn more about the CoCalc platform here.
R in Jupyter Notebooks
CoCalc offers a complete rewrite of the classical Jupyter notebook interface. It is tightly integrated into CoCalc and adds real-time collaboration, time-travel history and much more.
This rewrite does not change the underlying Jupyter notebook file format. Therefore, you can download your
*.ipynbfile at any time and continue working in another environment.
Despite that, there is also support for running the "Classical Jupyter notebook".
Extensive LaTeX support for R
The fully integrated CoCalc latex editor covers all your basic needs for working with
.Rtexfiles. The document is synchronized with your collaborators in real-time and everyone sees the very same compiled PDF. In particular, this LaTeX editor
- Manages the entire compilation pipeline for you,
- Automatically processes
.Rtexfiles using Knitr,
- Supports forward and inverse search to help you navigating in your document,
- Captures and shows you where LaTeX or R error happen,
- and via "TimeTravel", you can go back in time to see your latest edits in order to easily recover from a recent mistake.
Combined, this means you can do your entire workflow online on CoCalc:
You can edit RMarkdown files in CoCalc's native code editor.
The source file is processed according to the YAML-frontmatter configuration and the view of the generated file is automatically updated — in the HTML or PDF panel.
Syntax highlighting for markdown and emedded programming code — according to their language — makes it easy to visually understand the source file.
CoCalc's library features selected example files to get started quickly: e.g. HTML reports, article templates and a beamer presentation.
CoCalc is able to format your R code.
By simply clicking one button, your R source code is formatted in a clean and consistent way.
This reduces cognitive load reading source code, brings everyone in the team on the same page, and reduces misunderstandings.
R code formatting works with pure
.rfiles and Jupyter Notebooks running an R kernel.
You can share your files on CoCalc with project collaborators. Modifications are synchronized in real time. Watch the cursors of others while they edit the document. You are also notified about the presence of watching collaborators.
Additionally, the status and results of all computations in the currently running kernel session are also synchronized, because it is fully hosted on CoCalc.
Together, everyone involved experiences the document in exactly the same way.
All your existing R scripts run on the command line. Open a Terminal and you find yourself in a familiar Linux shell with a local filesystem for your data files, access to Git and much more... Feel at home and run your analysis as usual!
Terminals can be used by multiple users at once. This means you can work with your collaborators in the same session at the same time. Everyone sees the same output, and via side chat next to the terminal, the whole team can coordinate what you're doing.
Beyond that, you can simultaneously work with several terminal sessions. This gives you the ability to run your code concurrently.
For long-running programs, you can even close your browser and check upon the result later.
Chatrooms and Side-chat
Collaboration is a first class citizen on CoCalc. A side-by-side chat for each file gives you the ability to discuss the content with your colleagues or students.
Additionally, little avatars give you presence information about who is currently also working on that file.
Collaborators who are not online will be notified about new messages the next time they sign in.
Chat supports markdown formatting and LaTeX formulas.
Managed R Environment
CoCalc makes sure that the computational environment for R is regularly updated and ready to work with. Our goal is enabling you to get started with your analysis without any overhead.
Look at our list of available packages in more detail. If something is missing, we're glad to learn about it and install that package globally.
The Time-travel feature is specific to the CoCalc platform. It records all your changes in editable files like R source code, Jupyter notebook and LaTeX documents in fine detail. You can go back and forth in time across hundreds of changes to recover your previous edits.
This allows you to easily recover parts of previous versions of your file, by copy/pasting the part you accidentally changed.
You can also relive the entire process of editing the file from the very start. This lets you discover how you arrived at a particular solution and see what you (or your student) attempted before the final solution.
Every couple of minutes, all files in your project are saved in consistent read-only snapshots.
This means you can always recover older versions of your files in case they got corrupted or accidentally deleted.
CoCalc helps you share your work with the world. It offers hosting of shared documents, which includes Jupyter notebooks, PDF files, image files, and associated data files.
Under the hood, CoCalc uses a novel renderer which generates a static HTML representation on the server side and even includes pre-rendered LaTeX formulas. This approach does not suffer from the same shortcomings as other solutions based on nbconvert.
Example: Published R notebook.