Chapter 6. Domain-specific Applications

In this chapter, we will cover the following topics:

  • Dealing with regular expressions
  • Analyzing PDF reports in a folder with the tm package
  • Creating wordclouds with the wordcloud package
  • Performing a Twitter sentiment analysis
  • Detecting fraud in e-commerce orders with Benford's law
  • Measuring customer retention using cohort analysis in R
  • Making a recommendation engine
  • Performing time series decomposition using the stl() function
  • Exploring time series forecasting with forecast()
  • Tracking stock movements using the quantmode package
  • Optimizing portfolio composition and maximizing returns with the Portfolio Analytics package
  • Forecasting the stock market

Introduction

I have to be honest: one of the things I love the most about R is the huge amount of domain-specific packages.

I am sure you know that feeling. You start working on a new topic, let's say financial portfolio optimization. You start studying a bit of theory and then ask yourself, "Will there be an R package for this?"

In 90 percent cases, the answer will be "Yes." Actually, if R can be considered a powerful programming language, it is in domain-specific applications that we can appreciate its true power.

As of June 24, 2015, 6,712 packages for Windows OS were computed. We could even paraphrase that well-known Apple remark into:

"There's a package for that."

Chapter 7, Developing Static Reports, which follows, highlights this R richness, showing 13 domain applications where specific packages play a central role.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset