Close Navigation
Learn more about IBKR accounts
R Quarto<sup src=

R Quarto©: New Boundary In Financial Reporting Services

Posted August 28, 2023
Roberto Delgado Castro
Roberto Delgado Castro

First edition.
Roberto Delgado Castro
Data Professional and Compliance Officer
robdelcas at gmail.com

Introduction


Reporting services tasks are the heart of finance operational processes in organizations.

The way companies manage their financial information within the whole organization defines the quality of managerial policies and procedure applied in a certain period of time. From “macro processes” such as the whole accounting cycle, to “micro processes” like the issue of short-daily financial or statistical reports, the way crucial information is shared marks, in an important way, success in market.

Actually, almost all operational-administrative processes within organizations are being migrated to cloud-digital and web formats. Why? Security, dynamism, accessibility and flexibility. With much more reason, reporting services have been managed using cloud-based and digital technologies instead of the old-fashioned physical-traditional formats.

Precisely, R Quarto© is a fantastic tool to analyze, share and reproduce digital-format reports, especially financial documentation.


R Quarto Overview

According to the official webpage, Quarto© “is a multi-language, next-generation version of R Markdown from Posit and includes dozens of new features and capabilities while at the same being able to render most existing Rmd files without modification” (1).

If R Markdown has been a tech marvel for years and a “star” in the data science world, Quarto© is an improved version full of new and innovative advantages. It can generate dynamic documents using Python and R, and it also allows the publishing of high-quality articles, reports, presentations, websites and books in HTML, PDF, MS Word, ePub and more formats. It is also capable of adding interactivity to messages to engage readers.

Get Started with Quarto: Step by Step.

In order to extract all its benefits and before using it, two essential steps must be followed:

  1. Install Quarto©. Go to Quarto official website (quarto.org) to download the whole package.
  2. Choose the tool and begin typing code to provide format and structure to reports.

HTML Basic Reports with Quarto: Step by Step

Once Quarto© has been properly installed, in order to develop a basic HTML report with some data frames and visualizations, the following steps must be followed:

  1. Header code: to begin the construction of the report, a header must be defined. Such a header, at least, must have the following variables: title, format, editor and page layout. The following image shows a typical structure of a header:

  2. Libraries chunk: In order to let R understand the intentions of the developer related to their purposes, a variety of libraries must be installed using an exclusive chunk. The following image shows an example of some libraries needed to execute the code:


    Be sure to define, in such a chunk, that its content will not be included in the report by defining a false clause in the include variable.
  3. Data import chunk: Use an exclusive chunk to import the input data. Just as in RMarkdown, type a code to import the input database by defining a new variable with the name of such a database and, then, adding a read_delim function with the path of the database in the local terminal, in order to let R go and find the proper information in the correct place.



    Be sure to define, in such a chunk, an ECHO FALSE and an INCLUDE FALSE clause to let R skip such information for publication purposes at the moment of generating the final report.

    Also, in order to complete the import process, it is important to use the READR package and define it inside the chunk.
  4. Text typing: It is time to give a body to the report. For that, just type the content needed. You can use headers and normal text to provide order and structure. There is no need to type the text inside a specific chunk. The following image shows an example:


  5. Adding data frames: The same code that was used to develop data frames in a common R Notebook file should be used to include it in the Quarto© HTML report. Be sure to define, in such a chunk, an ECHO FALSE and an INCLUDE FALSE clause to let R skip such information for publication purposes at the moment of generating the final report. The code should be typed inside a chunk.
  6. Adding visualizations: The same code that was used to develop visualizations (plots) in a common R Notebook file should be used to include it in the Quarto© HTML report. The code should be typed inside a chunk.
  7. Render: execute the code: Once the code has been typed and reviewed, it could be rendered in order to generate the HTML report. R will process the code and display the document in an HTML format in an internet browser. This report will be executed in the developer’s local terminal. To render the code, just press the RENDER button as follows:



Publishing R Quarto© documents.

A fantastic tool to publish Quarto© HTML reports is the usage of Quarto Pub. Quarto© official website indicates that “ it is a free publishing service for content created with Quarto. Quarto Pub is ideal for blogs, course or project websites, books, presentations, and personal hobby sites. It’s important to note that all documents and sites published to Quarto Pub are publicly visible. You should only publish content you wish to share publicly” (1).

In addition, Quarto© official website states that “there are two ways to publish content to Quarto Pub” (1) (both are covered in more detail below):

  1. Use the quarto publish command to publish content rendered on your local machine (this is the recommended approach when you are getting started).
  2. If you are using GitHub, you can use a GitHub Action to automatically render your project and publish the resulting content whenever your code changes” (1).

Why R Quarto?

The usage of Quarto© has, in general, some crucial advantages:

  1. It could be integrated with Python and JavaScript.
  2. It creates dynamic content with high-quality formats.
  3. It engages readers by adding interactive data exploration.
  4. It brings the possibility of publishing reports.

Why is R Quarto Important for Financial Reporting Services?

The usage of Quarto© for financial reporting services is crucial for the following premises:

  1. The interactivity and high-quality format features engage the attention of managers and supervisors.
  2. The possibility of publishing these kinds of reports in HTML formats allows sharing crucial content with managerial levels in almost real-time, an element that brings accessibility and flexibility to access strategic content.
  3. It constitutes an innovative and cutting-edge tool to share strategic content in a new-shocking format.


References

  1. R Quarto official website. Available at: https:// https://quarto.org/docs/get-started/hello/rstudio.html

Join The Conversation

If you have a general question, it may already be covered in our FAQs. If you have an account-specific question or concern, please reach out to Client Services.

Leave a Reply

Your email address will not be published. Required fields are marked *

Disclosure: Interactive Brokers

Information posted on IBKR Campus that is provided by third-parties does NOT constitute a recommendation that you should contract for the services of that third party. Third-party participants who contribute to IBKR Campus are independent of Interactive Brokers and Interactive Brokers does not make any representations or warranties concerning the services offered, their past or future performance, or the accuracy of the information provided by the third party. Past performance is no guarantee of future results.

This material is from Roberto Delgado Castro and is being posted with its permission. The views expressed in this material are solely those of the author and/or Roberto Delgado Castro and Interactive Brokers is not endorsing or recommending any investment or trading discussed in the material. This material is not and should not be construed as an offer to buy or sell any security. It should not be construed as research or investment advice or a recommendation to buy, sell or hold any security or commodity. This material does not and is not intended to take into account the particular financial conditions, investment objectives or requirements of individual customers. Before acting on this material, you should consider whether it is suitable for your particular circumstances and, as necessary, seek professional advice.

IBKR Campus Newsletters

This website uses cookies to collect usage information in order to offer a better browsing experience. By browsing this site or by clicking on the "ACCEPT COOKIES" button you accept our Cookie Policy.