# Manipulating Data Frames Explore 1985 Cars Dataset

Welcome to the Get Help category!

This is where you can ask questions about your code. Some important things to remember when posting in this category

• Learn how to ask a good question and get a good answer!
• Remember to include a link to the exercise you need help with!
• Once you understand a new concept, come back and try to help someone else!

Hi everyone! I am doing the exercise of the 1985 Cars Dataset (<https://www.codecademy.com/courses/learn-r/projects/1985-cars-r-project) and I am stuck in task 8 ( Add a new column to `cars` called `mpg_diff_from_threshold` . This will measure how far each carβs highway mpg is from 30 mpg. View the updated `cars` dataframe.)

This error comes up and I really donβt know what I am doing wrong, probably the most silly thing!

``````# add column
cars >%>
mutate(mpg_diff_from_threshold = highway_mpg - mpg_threshold)
``````
``````Error: <text>:2:7: unexpected input
2: cars >%>
^
``````

Can someone help me? thanks!

Your pipe is the wrong way. The percent signs surround the greater than sign.` %>%`

Thanks! I realised just after posting, and also I missed the β/30β at the end. It worked and I was able to finish the exercise.

Question 10 asks for " Which cars have the highest miles per gallon on the highways? To find this, arrange the rows of `mpg_exceeds_threshold` by `mpg_diff_from_threshold` descending. Save this new dataframe as `mpg_exceeds_threshold` "
I get the error ```
Error: Problem with `filter()` input `..1`.
Input `..1` is `mpg_exceeds_threshold`.
Input `..1\$risk_factor` must be a logical vector, not a double.

``````
mpg_exceeds_threshold <- mpg_exceeds_threshold %>%

filter(mpg_exceeds_threshold) %>%

arrange(desc(mpg_diff_from_threshold))``````

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.