Learn R Cars 1985: "Could not find function %>%"

Good morning! I’m working on the 1985 Cars project and stuck with a repeated error.

Starting at Task 4 (removing a column), I’m getting the following error:
"Error in cars %>% select(-normalized_losses): could not find function “%>%”

Here’s my code:


# Task 1

```{r message=FALSE, warning=FALSE, error=TRUE}

# load libraries

data(readr)

data(dplyr)

Task 2


# load data

cars <- read.csv("cars85.csv")

Task 3


# inspect data

head(cars)

summary(cars)

Task 4


# select columns

cars <- cars %>%

select(-normalized_losses)

I tried to move on to following tasks (since further task don’t depend on this one being successful) but continued to receive the same error about piping not being a recognized function.

I’m fairly new at this and so I’m sure I’m making a very silly error. Any help would be appreciated. Thanks!

Have a look at the lesson: Importing Packages

// You wrote:
data(readr)
data(dplyr)

// It should be:
library(readr)
library(dplyr)
1 Like

I knew it was something simple like that. Thank you!

1 Like