Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying R Programming Fundamentals
  • Table Of Contents Toc
  • Feedback & Rating feedback
R Programming Fundamentals

R Programming Fundamentals

By : Kaelen Medeiros
3 (1)
close
close
R Programming Fundamentals

R Programming Fundamentals

3 (1)
By: Kaelen Medeiros

Overview of this book

R Programming Fundamentals, focused on R and the R ecosystem, introduces you to the tools for working with data. You’ll start by understanding how to set up R and RStudio, followed by exploring R packages, functions, data structures, control flow, and loops. Once you have grasped the basics, you’ll move on to studying data visualization and graphics. You’ll learn how to build statistical and advanced plots using the powerful ggplot2 library. In addition to this, you’ll discover data management concepts such as factoring, pivoting, aggregating, merging, and dealing with missing values. By the end of this book, you’ll have completed an entire data science project of your own for your portfolio or blog.
Table of Contents (6 chapters)
close
close

Chapter 3: Data Management

The following are the activity solutions for this chapter.

Activity: Creating and Manipulating Factor Variables

Use the following code to load the datasets library:

library(datasets)

Use the following code to load the diamonds dataset:

data("diamonds")

The function str() can be used to examine the diamonds dataset as follows:

str(diamonds)

We understand that there are three factors of ordered type as we examine the diamonds dataset. To identify the class of those factors, we can use the function class() as follows:

class(diamonds$cut)
class(diamonds$color)
class(diamonds$clarity)

The following code can be used to load the midwest dataset:

data("midwest")

The str() function can be...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech

Create a Note

Modal Close icon
You need to login to use this feature.
notes
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Delete Note

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Edit Note

Modal Close icon
Write a note (max 255 characters)
Cancel
Update Note

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY