Reports

Reports make sharing ideas easy and let you avoid copy/pasting results into emails or slides. With a single click, you can present your text, code, and charts from notebooks and then easily share with others in your company by sending them a link.

Publish a Report

You can publish the following file types as a report:

  • .ipynb
  • .md
  • .html (e.g. from RStudio’s knit function)

There are two ways to publish a report. From a file preview page for the file you wish to publish, click the Publish button above the file content. Or, use the Publish a Report option in the project actions dropdown. On the publishing menu displayed, fill in the path of your file and give the report a title and description.

_images/7b24c34-report_versions_pv6.18.0.png

Preparing an .rmd File for Publishing

R Markdown files only save their outputs (like charts and tables) in a running RStudio session rather than saving outputs to the .rmd file. To publish an R Markdown document as a report on the Platform, first convert it to an HTML document inside your RStudio session.

From RStudio, run the R Markdown file from top to bottom, loading all the charts, tables, or other outputs into the view. Then in the RStudio console, run the following command:

rmarkdown::render('my-analysis.Rmd')

At a minimum, the header of the R Markdown should set the output type as HTML. Here’s an example header:

---
title: "My Analysis"
output: html_document
---

The resulting HTML file should be synced back to the project’s repository. Then from the Files tab or the actions dropdown, publish the HTML file as a report. You may choose to version your HTML files in the Git repo or delete them after publishing.

To control whether your audience sees the code for each cell of an R Markdown document, use the echo option, documented here. For example, to prevent code from making it into the report, structure your code cells like this:

### Here's where my analysis gets interesting.

'''{r echo=FALSE}
plot(some_data)
'''

View and Manage a Report

Visit your report from the project Outputs page. On the Report page, you can remove a report with the Delete button, located above the report content.

Before sharing a link to a report with teammates, first make sure they’re a member of the project. The View permission level is appropriate for teammates who are visiting a project just to review your reports.

_images/028bbd8-report_versions2_pv6.18.0.png

Report Versions

Report versions allow you to make changes to an existing report. Instead of creating a whole new report, you can choose to simply bump up the version number of that report. This is particularly useful when data is being updated and you want to re-run the notebook and update the charts.

When looking at the report itself, you can see the version list in the Version dropdown menu on the left. Here you can switch between different report versions. In the top right, you also see different options under Delete: delete Current Version or All Versions. You can also publish a new version of the report by clicking on Publish New Version. There are two ways to create a new version of a report, discussed in more detail in the following sections.

Publishing a New Version from Within a Report

Exemplified in the snapshot above, the first way to create a new version of a report is to go in the report itself and click Publish New Version. As a result, the following window will appear:

_images/6cc3c84-report_versions3_pv6.18.0.png

Double check the branch and commit ID. Make sure they are the ones you want to capture in your new report version. If you go back to the report, you should see that Version 2 is the one being used.

Publishing a New Version from the Action Button

You can also use the action button to add a version to an existing report. Choose the Publish a Report option. Within that window, choose your branch and select the option stating “Add a version to an existing report.” Write the path of your notebook and enter the name of your report. After clicking Publish, a new version of your report will appear.

_images/d30a5d4-report_versions4_pv6.18.0.png

Delete a version

You can also delete a version of your report. Simply go in your report and choose either the Current Version or All Versions option under the Delete dropdown.

_images/f60798f-report_versions5_pv6.18.0.png