The subject of this textbook is to act as an introduction to data science / data analysis applied to finance, using R and its most recent and freely available extension libraries. The targeted academic level is undergrad students with a major in data science and/or finance and graduate students, and of course practitioners or professionals who need a desk reference.

  • Assumes no prior knowledge of R
  • The content has been tested in actual university classes
  • Makes the reader proficient in advanced methods such as machine learning, time series analysis, principal component analysis and more
  • Gives comprehensive and detailed explanations on how to use the most recent and free resources, such as financial and statistics libraries or open database on the internet

chapter 1|6 pages

Your Working Environment

chapter 2|10 pages

Reading Data in R

chapter 3|14 pages

Financial Data

chapter 4|38 pages

Introduction to R

chapter 5|26 pages


chapter 6|20 pages

Data Transformation

chapter 7|12 pages

Merging Data Sets

chapter 8|30 pages

Graphing Using Ggplot

chapter 10|26 pages


chapter 11|12 pages

Modeling Returns & Simulations

chapter 13|10 pages

Fixed Income

chapter 14|8 pages

Principal Component Analysis

chapter 15|20 pages


chapter 16|14 pages

Value at Risk

chapter 17|24 pages

Time Series Analysis

chapter 18|28 pages

Machine Learning