New book and package pmfdR

[This article was first published on R and Finance, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Processing and modelling financial data with R –

My Portuguese book about finance and R was published a couple of months ago and, given its positive feedback, I decided to work on the english version immediately. You can find details about my experience in self publishing the book in this post.

The English book is not a simple translation of text and examples. This is a long term project that I always dreamed of doing. With time, I plan to keep the Portuguese and English version synchronized. The feedback I got from the Portuguese version was taken into account and I wrote additional sections covering advanced use of dplyr with list-columns, storing data in SQLITE, reporting tables with xtable and stargazer, and many more.

The book is not yet finished. I’m taking my time in reviewing everything and making sure that it comes out perfectly. I believe it will be ready in a few months or less. If you are interested in the book, please go to its website where you can find its current TOC (table of contents), code and data.

If you want to be notified about the publication of the book, please sign this form and I’ll let you know as soon as it is available.

Package pmfdR

Yesterday I released package pmfdR, which provides access to all material from my book Processing and Modelling Financial Data with R, including code, data and exercises.

The exercises are still not complete. I expect to have at least 100 exercises covering all chapters of the book. As soon as the book is finished, I’ll starting working on it.

With package pmfdR you can:

  1. Download data and code with function pmfdR_download.code.and.data
  2. Build exercises with function pmfdR_build.exercise

Downloading code and data

All the R code from the book is publicly available in github. Function pmfdR_download.code.and.data will download a zip file from the repository and unzip it at specified folder. Have a look in its usage:

if (!require(pmfdR)){
  install.packages('pmfdR')
  library(pmfdR)
} 

my.lan <- 'en' # language of code and data ('en' or 'pt-br')

# dl may take some time (around 60 mb)
pmfdR_download.code.and.data(lan = my.lan)

dir.out <- 'pmfdR-en-code_data-master'

# list R code
list.files(dir.out, pattern = '*.R')
list.files(paste0(dir.out,'/data'))

Building exercises

All exercises from the book are based on package exams. This means that every reader will have a different version of the exercise, with different values and correct answer. I’ve written extensively about the positive aspects of using exams. You can find the full post here

You can create your custom exercise file using function pmfdR_build.exercise. Give it a try, just copy and paste the following chunk of code in your R prompt.

if (!require(pmfdR)){
  install.packages('pmfdR')
  library(pmfdR)
} 

my.lan <- 'en' # language of exercises
my.exercise.folder <- 'pmfdR-exercises' # name of folder with exercises files (will download from github)
my.pdf.folder <- 'PdfOut' # name of folder to place pdf file and answer sheet

pmfdR_build.exercise(lan = my.lan,
                     exercise.folder = my.exercise.folder, 
                     pdf.folder = my.pdf.folder)

list.files(my.pdf.folder)

To leave a comment for the author, please follow the link and comment on their blog: R and Finance.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)