R

GetFREData available in CRAN!

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.

GetDFPData2 available in CRAN!

After testing the package extensivelly, GetDFPData2 is finally available in CRAN. GetDFPData2 is the second and backwards incompatible version of GetDPFData, a R package for downloading annual financial reports from B3, the Brazilian financial exchange. Unlike its first iteration, GetDFPData2 imports data using a database of csv files from CVM, which makes it execution much faster than its predecessor. However, the output is slightly different. A shiny app – web interface – is also available at https://www.msperlin.com/shiny/GetDFPData2/. The previous version, GetDFPData, is deprecated and will not be developed any further.

A clever bash script for R Users

Back in 2017 I wrote a blog post describing a simple bash script for installing R in a Ubuntu setup. The problem with this script, and many others found in the internet, is that they quickly become obsolete due to changes in Ubuntu, R and RStudio. For example, if Ubuntu version changes from “trusty” to “focal”, the link to the CRAN ppa also changes. The same is true with RStudio, which does not provide installation by apt, only downloadable .deb files from its website. Today I manage to develop a clever bash script that uses the internet and local files to find out the current version of all software.

bookdown + exams + webex

It’s been three years since I’ve been using package bookdown for compiling and distributing three different books in Amazon and the web. It helped me greatly in all my book projects and I’m always grateful to Yihui Xie for providing such a useful tool at the right time. However, bookdown offers no support for chapter exercises of any sort. While you can write exercises in plain RMarkdown, it is not a good solution for a long term project such as a technical book. When writing the latest edition of Analyzing Financial and Economical Data with R, I aimed for a work cycle where the 100 plus exercises and their solutions were reproducible and easier to maintain.

Ten years as a professor -- six advices to young academics

In the 18th of march 2021 I’ll complete exactly ten years since finishing my PhD and taking a professorship position at UFRGS, south of Brazil. In this post I’ll write about what I learned during this period and, hopefully, help other academics that are just starting out. This post is the summary of a talk I had with a former PhD student. I’m fully aware that academic work can be very different across countries and institutions. I don’t claim to have all the answers to all the problems. But, these are a couple of advice that would certainly help me in my starting years.

Update on the Shiny/Web Interface of GetDFPData2

GetDFPData is an academic project to provide free and unrestricted access to financial reports from B3, the brazilian exchange. Back in 2020 I split the code of GetDFDData into two distinct packages: GetDFPData2 and GetFREData. In short, I’ve found a new data source at CVM (comissão valores mobiliários) that is much easier to work than B3’s site. While the code in GetDFPData2 is becoming stable and will soon be released in CRAN, the shiny app was missing this important update. Finally got some free time to work on the shinny app once again.

Compiling Book Exercises to pdf | html | Moodle | Blackboard

The revised second edition of Analyzing Financial and Economic Data with R presents more than 100 exercises at the end section of all chapters. All exercises are freely available in the exams format, meaning that any R tutor can export the same exercises to pdf, html or e-learning platforms. In this post I’ll show how to compile exercises to pdf, html, Moodle and blackboard. Installation The first step is to install package afedR with devtools: devtools::install_github('msperlin/afedR') Another requirement is a working Latex instalation. For that, use tinytex: tinytex::install_tinytex() Compiling Exercises How it works?

Revision of book "Analyzing Financial and Economic Data with R"

I recently launched the third edition of my portuguese R book (adfeR-pt-br), with many due changes from the international version (afedR-en). To make it clear, the second edition of afedR (en) was ahead in content and the third edition of adfeR (pt-br) closed that gap. But, as it usually is with a time evolving platform such as R, the code in afedR-en changed with the deprecation and arrival of new functions and packages. In order to keep the content up to date, I published a revision of the book in Amazon and its web version.

LANÇAMENTO - Análise de Dados Financeiros e Econômicos com o R (Terceira Edição)

É com muito prazer que comunico o lançamento oficial da terceira edição do livro Análise de Dados Financeiros e Econômicos com o R. Encontrarás a obra na Amazon.com.br como um ebook ou livro impresso. A versão online do livro com os primeiros sete capítulos está disponível neste link. Maiores detalhes, incluindo material suplementar, encontram-se na página do livro. A primeira edição foi lançada em 2016 e, desde então, venho atualizando o conteúdo com novos pacotes e novos capítulos. A terceira edição contempla as seguintes mudanças: Todo o conteúdo do livro agora é disponibilizado via pacote adfeR – link github – facilitando muito a reprodução de todos os exemplos de código.

Compilando Exercícios do Livro para pdf | html | Moodle | Blackboard

A terceira edição do livro Análise de Dados Financeiros e Econômicos contém mais de 100 exercícios de final de capítulo, com todas soluções disponíveis na página do livro. Alternativamente, professores e instrutores podem compilar arquivos pdf dos exercícios para seus alunos com o pacote adfeR. O primeiro passo é instalar o pacote via devtools e também o exams: devtools::install_github('msperlin/adfeR') Outro requisito é a instalação do tinytex e Latex/texlive para a compilação em pdf: tinytex::install_tinytex() Como funciona? Todos exercícios do livro estão no formato do pacote exams. Cada exercício é um arquivo .