I’m currently attempting the project for the Data Frames lesson in R. The directions are making sense to me, and I felt I was coding correctly and can’t find my error.
For Task 4, I got this error message: " ```
Error in select(-normalized_losses): object ‘normalized_losses’ not found
For Task 6, i got this error message: " ```
Error in rename(risk_factor = symboling): object 'symboling' not found
For Task 8, I got this error message: " ```
Error in mutate(mpg_diff_from_threshold = highway_mpg - mpg_threshold): object ‘highway_mpg’ not found
I am extremely new to coding! I have attached my code below, and here is a link to the project page: [https://www.codecademy.com/courses/learn-r/projects/1985-cars-r-project]
I am sure I am just making a simple mistake, but I’m so stuck!
---
title: "1985 Cars"
output: html-notebook
---
# Task 1
```{r message=FALSE, warning=FALSE, error=TRUE}
# load libraries
library(readr)
library(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)
Task 5
# view columns
colnames(cars)
Task 6
# rename column
cars %>%
cars <- rename(risk_factor = symboling)
colnames(cars)
Task 7
# define threshold
mpg_threshold <- 30
Task 8
# add column
cars %>%
cars <- mutate(mpg_diff_from_threshold = highway_mpg - mpg_threshold)
head(cars)