Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Data Wrangling with R

You're reading from  Data Wrangling with R

Product type Book
Published in Feb 2023
Publisher Packt
ISBN-13 9781803235400
Pages 384 pages
Edition 1st Edition
Languages
Concepts
Author (1):
Gustavo R Santos Gustavo R Santos
Profile icon Gustavo R Santos

Table of Contents (21) Chapters

Preface Part 1: Load and Explore Data
Chapter 1: Fundamentals of Data Wrangling Chapter 2: Loading and Exploring Datasets Chapter 3: Basic Data Visualization Part 2: Data Wrangling
Chapter 4: Working with Strings Chapter 5: Working with Numbers Chapter 6: Working with Date and Time Objects Chapter 7: Transformations with Base R Chapter 8: Transformations with Tidyverse Libraries Chapter 9: Exploratory Data Analysis Part 3: Data Visualization
Chapter 10: Introduction to ggplot2 Chapter 11: Enhanced Visualizations with ggplot2 Chapter 12: Other Data Visualization Options Part 4: Modeling
Chapter 13: Building a Model with R Chapter 14: Build an Application with Shiny in R Conclusion Other Books You May Enjoy

To get the most out of this book

The get the most out of the content presented in this book, it is expected that you have a minimum knowledge of object-oriented programming (creating variables, loops, and functions) and have already worked with R. A basic knowledge of data science concepts is also welcome and can help you understand the tutorials and projects.

All the software and code are created using RStudio for Windows 10, and if you want to code along with the examples, you will need to install R and RStudio on your local machine. To do that, you should go to https://cran.r-project.org/, click on Download R for Windows (or for your operating system), then click on base, and finally, click on Download R-X.X.X for Windows. This will download the R language executable file to your machine. Then, you can double-click on the file to install, accepting the default selections.

Next, you need to install RStudio, renamed to Posit in 2022. The URL to download the software is found here: https://posit.co/download/rstudio-desktop/. Click on Download and look for the version of your operating system. The software has a free of charge version and you can install it, accepting the default options once again.

The main libraries used in the tutorials from this book are indicated as follows:

Software/Library

Version

R

4.1.0

RStudio

2022.02.3+492 for Windows

Tidyverse

1.3.1

Tidytext

0.3.2

Gutenbergr

0.2.1

Patchwork

1.1.1

wordcloud2

0.2.1

ROCR

1.0-11

Shinythemes

1.2.0

Plotly

4.10.0

Caret

6.0-90

Shiny

1.7.1

Skimr

2.1.4

Lubridate

1.8.0

randomForest

4.7-1

data.table

1.14.2

To install any library in RStudio, just use the following code snippet:

# Installing libraries to RStudio
install.packages(“package_name”)
# Loading a library to a session
library(package_name)

In R, it can be useful to remind yourself of, or have in mind, these two code snippets. The first one is how to write for loops. We can write it as, for a given condition, execute a piece of code until the condition is not met anymore:

for (num in 1:5) {
    print(num)
}

The other one is the skeleton of a function written in R language, where we provide variables and the code of what should be done with those variables, returning the resulting calculation:

custom_sum_function <- function(var1, var2) {
    # Function code
    my_sum = sum(var1 + var2)
    return(my_sum)
}

If you are using a digital version of this book, we advise you to type the code yourself or access the code from the book’s GitHub repository, preventing any potential errors with code broken due to copy and paste.

lock icon The rest of the chapter is locked
Next Chapter arrow right
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}