Marcelo S. Perlin | A blog about R and Finance
1,488 FOLLOWERS
Marcelo works as an assistant professor of Finance at Federal University of Rio Grande do Sul (UFRGS). In this blog he writes about CRAN packages and other ideas about finance and R, research papers that he is currently working on. Follow this blog to know more about R.
Marcelo S. Perlin | A blog about R and Finance
1y ago
Another year has passed and now its time to discuss what happened in this cycle, along with future projects.
Year 2023 passed by very quickly, and I’m grateful for everything I’ve learned and experienced. Here are the highlights from my work.
Highlights of 2023 and 2022
Academic Papers
I co-authored a single academic papers during this period:
What is the sustainable withdraw rate for Brazil?
However, many papers are ready (or almost ready) for submission. I expect that 2024 will be a year with many publications.
Books
I revised book Analyzing Financial and Economic Data with R for its se ..read more
Marcelo S. Perlin | A blog about R and Finance
1y ago
Back in 2020 I started to compile and share financial data in dataverse. The data covers corporate finance events from the DFP and FRE systems. The available tables are the same I use for my research and teaching material, and will be updated once a year.
Today I updated all datasets. The available data are:
R Package
Source of Data
Description
Direct Link
Last Update
GetTDData
Tesouro Nacional
Prices and yields of brazilian sovereign bonds
Link
2023-04-18
GetFREData
CVM
Corporate dataset from FRE systems
Link
2023-04-18
GetDFPData2
CVM
Annual Financial Reports from DFP system
Link ..read more
Marcelo S. Perlin | A blog about R and Finance
1y ago
It is with great pleasure that I announce the third edition of “Analyzing Financial and Economic Data with R”. This work is an international edition of my R book and a lifelong project. My plan is to keep improving the content as much as possible over the next years. I’m happy to see that, just like good wine, the content of the book only gets better with time.
Besides the usual revision and improvement of the text, here are the main changes:
New pipeline operator A new pipeline operator (|>) was introduced in R version 4.1.0. While the old pipeline from magrittr can still be found in the w ..read more
Marcelo S. Perlin | A blog about R and Finance
1y ago
The third edition of Analyzing Financial and Economic Data with R provides a total of 98 end-of-chapter exercises. All activities are freely available in the exams format, meaning that any R tutor can export the same exercises and solutions to use in their own class. In this post I’ll show how to compile exercises to pdf, html, Moodle and blackboard.
Installation
The first step is to install package afedR3 with devtools:
if (!require(devtools)) install.packages('devtools')
devtools::install_github('msperlin/afedR3')
Another requirement is a working Latex instalation. For that, use tinytex ..read more
Marcelo S. Perlin | A blog about R and Finance
1y ago
It is with great pleasure that I officially announce the publication of my book Visualização de Dados com o R. The content of the book is an extension of chapter 10 of afedR. The book is written in portuguese and available at Amazon and online:
ebook
paperback
hardcover
Online version (chapters 01-03)
You can find more details in its own blog page ..read more
Marcelo S. Perlin | A blog about R and Finance
1y ago
Back in 2020 I started to compile and share financial data in dataverse. The data covers corporate finance events from the DFP and FRE systems. The available tables are the same I use for my research and teaching material, and will be updated once a year.
Today I updated all datasets. The available data are:
R Package
Source of Data
Description
Direct Link
Last Update
GetTDData
Tesouro Nacional
Prices and yields of brazilian sovereign bonds
Link
2022-04-06
GetFREData
CVM
Corporate dataset from FRE systems
Link
2022-04-06
GetDFPData2
CVM
Annual Financial Reports from DFP system
Link ..read more
Marcelo S. Perlin | A blog about R and Finance
1y ago
Package BatchGetSymbols facilitates importation of Yahoo Finance data directly into R and is one of my most popular R packages, with over 100k installations since conception (around 2500 downloads per month). However, I developed BatchGetSymbols back in 2016, with many bad structural choices from my part.
For years I wanted to improved the code but always restrained myself because I did not want to mess up the execution of other people’s code that was based on BatchGetSymbols. In order to implement all the breaking changes and move forward with the package, I decided to develop a new (and fres ..read more
Marcelo S. Perlin | A blog about R and Finance
1y ago
Hadley Wickham recently released an online version of Mastering Shiny. The book is great! If you haven’t read it, do it fast! On a side note, it is really amazing how much of good and curated content you can get for free in R. When I started programming back in 2007, the first step was buying a brand new – and sometimes expensive – book about the language. There were blogs and other sites, but most content was very basic and not curated, meaning that the posted code most of the time did not work. The new generation probably have no idea of how easy it is to start fresh on new code these days ..read more
Marcelo S. Perlin | A blog about R and Finance
1y ago
Back in 2020 I started to compile and share financial data in dataverse. The data covers corporate finance events from the DFP and FRE systems. The available tables are the same I use for my research and teaching material, and will be updated once a year.
Today I updated all datasets. The available data are:
R Package
Source of Data
Description
Direct Link
Last Update
GetTDData
Tesouro Nacional
Prices and yields of brazilian sovereign bonds
Link
2021-04-09
GetFREData
CVM
Corporate dataset from FRE systems
Link
2021-04-09
BatchGetSymbols
Yahoo Finance
Daily adjusted and unadjusted pr ..read more
Marcelo S. Perlin | A blog about R and Finance
1y ago
I’m happy to report that package GetFREData is now available in CRAN. This R package serves as an interface to all corporate datasets available in the FRE system, a vast and official repository of information about many different corporate events. All companies listed at B3 – Brazilian stock exchange – must report to FRE any significant change in their corporate structure. You can find more details about what is available in FRE in its web interface.
The R package fetches data from the CVM ftp, downloads and parses the xml files, and output several tables as a list. The corporate data includes ..read more