R Programming, Data Manipulation and Visualization Assignment

Download Solution Order New Solution

Assignment Task

 1. Data Manipulation

1.1. Load the "mtcars" dataset from R's built-in datasets.

1.2. Create a new column "disp_per_cyl" that calculates the displacement per cylinder by dividing "disp" by "cyl".

1.3. Filter the dataset to only include rows where "gear" is equal to 4.

1.4. Create a new dataframe that only includes the columns "mpg", "disp_per_cyl", and "gear".

1.5. Create a new column "disp_per_cyl_rounded" that rounds the "disp_per_cyl" column to two decimal places.

1.6. Use the "aggregate" function to calculate the mean "mpg" for each value of "gear" in the filtered dataframe

2. Data Visualization

2.1. Use the "ggplot2" library to create a scatterplot of "mpg" against "disp_per_cyl_rounded". Use "gear" as a color aesthetic.

2.2. Add a title to the plot and label the axes appropriately.

2.3. Use the "facet_wrap" function to create separate plots for each value of "gear".

2.4. Save the plot as a PNG file.

Conclusion: Write a brief summary of your findings and insights from the data manipulation, visualization

This IT Computer Science has been solved by our PhD Experts at My Uni Paper.

Get It Done! Today

Country
Applicable Time Zone is AEST [Sydney, NSW] (GMT+11)
+

Every Assignment. Every Solution. Instantly. Deadline Ahead? Grab Your Sample Now.