PyCharm
 
Get PyCharm

Work with R Markdown

Last modified: 26 May 2024

The R plugin for PyCharm provides handy capabilities to work with the R Markdown files. With the interactive editor, you can quickly add executable chunks of R code, run and debug them, and produce the HTML output.

The plugin supports different markdown content: documents, notebooks, presentations, and Shiny (interactive markdown).

When you create a new *.rmd file, you can select the file type:

Create a new Markdown file

Each file is create with a specific header that depends on its type:

This header is used to render output in an HTML file. To modify the default header, edit the R Markdown template in the project Settings.

In the R Markdown file you can add any context according to the Markdown syntax and some executable code chunks.

Once the code is added the execution actions become available through the Run menu in the gutter and in the chunk toolbar.

Executable code chunk in the editor

You can debug executable chunks in R Markdown files to detect and fix any errors in them.

You can create an HTML file that includes both the R Markdown source code and the results of its execution.

You can present your R markdown content in a form of presentation.

You can also build R Markdown with interactive content by using Shiny.