Homework Assignment: Exploring Gapminder Data with Tidyverse
Objective: To practice data manipulation and exploration using the tidyverse package in R by working with the gapminder dataset.
Instructions:
Dataset: Use the gapminder dataset from the gapminder package. You can load the dataset using the following code:
RCopy code
library(gapminder) data(“gapminder”)
Tasks:
Data Exploration (5 points): Begin by exploring the gapminder dataset to understand its structure and content. Use the head() and summary() functions to get a sense of the data. Explain briefly what the dataset contains.
Data Filtering (15 points): Perform the following filtering operations and provide the resulting data for each:a. Filter the dataset to include only rows where the year is 2007.b. Filter the dataset to include only rows where the country is either “United States” or “Canada” and the year is 2002 or 2007.c. Filter the dataset to include only rows where the population is greater than 1 billion.
Data Selection (10 points): Perform the following selection operations on the original dataset and not the dataset from step 2 and provide the resulting data for each:a. Select only the columns: “country,” “year,” “lifeExp,” and “pop.”b. Select all columns except “gdpPercap.”
Data Distinctness (10 points): Find and display a list of unique countries present in the original dataset. Explain how you ensured that the list contains only unique values.
Data Arrangement (10 points): Arrange the original dataset in descending order of “gdpPercap” and then in ascending order of “lifeExp.” Provide the resulting datasets as data frames.
Submission Guidelines:
Prepare an R script that includes the necessary code to complete the tasks.
Include comments in your code to explain your approach.
Create a report (in PDF or Word format) summarizing your findings and observations for each task.
Submit both the R script and the report in a zip file as your homework assignment.
Grading Rubric:
Each task will be graded out of the maximum points mentioned.
Correctness of the code and output will be evaluated.
Explanation and clarity in the report will be considered for grading.
Please complete the assignment and submit it as per the instructions. Good luck with your homework!
Place this order or similar order and get an amazing discount. USE Discount code “GET20” for 20% discount