Book Image

Hands-On Data Science with R

By : Vitor Bianchi Lanzetta, Doug Ortiz, Nataraj Dasgupta, Ricardo Anjoleto Farias
Book Image

Hands-On Data Science with R

By: Vitor Bianchi Lanzetta, Doug Ortiz, Nataraj Dasgupta, Ricardo Anjoleto Farias

Overview of this book

R is the most widely used programming language, and when used in association with data science, this powerful combination will solve the complexities involved with unstructured datasets in the real world. This book covers the entire data science ecosystem for aspiring data scientists, right from zero to a level where you are confident enough to get hands-on with real-world data science problems. The book starts with an introduction to data science and introduces readers to popular R libraries for executing data science routine tasks. This book covers all the important processes in data science such as data gathering, cleaning data, and then uncovering patterns from it. You will explore algorithms such as machine learning algorithms, predictive analytical models, and finally deep learning algorithms. You will learn to run the most powerful visualization packages available in R so as to ensure that you can easily derive insights from your data. Towards the end, you will also learn how to integrate R with Spark and Hadoop and perform large-scale data analytics without much complexity.
Table of Contents (16 chapters)

Retrieving text from the web

There are numerous ways to retrieve text from the web. The previous section used the Hypertext Transfer Protocol (HTTP) through the httr package to retrieve text from the web. A combination of substr() and regexpr() was then used to extract only a small piece of information from it.

This section will show you how to retrieve text from the web using two different packages:

  • rvest: This can easily perform common web scrapping tasks
  • rtweet: It works with Twitter's web API to gather data

There are numerous ways to use data gathered this way. To name a few, it could be used to develop stock trading, marketing strategies, train chatbots, run sentiment analysis, seeks candidates for a job, or phrase click baits. Our final goal in this chapter will be to check which packages are most tweeted by the R community. Before going any further, there is a very...