Getting started with dplyr

To start off with, I will create an R script called dplyr_intro.R and set up my R environment. First, you should set your working directory to the ch7 project folder. Next, you should read the fuel economyhttps://catalog.data.gov/dataset/consumer-price-index-average-price-data dataset into a dataframe as follows:

setwd("path/to/your/project/folder")vehicles<-read.csv("data/vehicles.csv")

The next step is to import the dplyr and tibble packages. In R, you can import a package using the library() function. The following lines import the dplyr package and the tibble package:

library('dplyr')library('tibble')

I will start with the select() function. The select() function allows you to select a certain number of columns ...

Get Practical Data Wrangling now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.