Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 1 Use the starwars dataset from the dplyr package i)Conduct the following to get a final tibble called summary. a. Remove the missing values

Question 1

Use the starwars dataset from the dplyr package

i)Conduct the following to get a final tibble called summary.

a. Remove the missing values from species.

b. Then, obtain the mean and median height and mass for each species. Use the functions summarise() and across() to obtain this.

c. Include an argument in the across function to name the new columns starting with the function name followed by an underscore and then the column name (e.g.: mean_height).

d. Assign the results to a tibble named summary.

e. Print summary. (6 marks)

ii) Use the results in (i) and select only the species and mean_height variables. Then arrange from highest to lowest.

Print the outputfor the first 10 observations.(4 marks)

iii) Use the original starwars datasetfrom the dplyr package and conduct the following:

a. Remove the missing values from species.

b. Group the data by gender and then species.

c. Then obtain the mean values of height and sort from highest to lowest for the masculine group and also from highest to lowest for the feminine group.

d. Finally extract the top three tallest groups for the masculine group and for the feminine group.

Print out this output which will have 6 observations. (5marks)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advertising & IMC Principles & Practice

Authors: Sandra Moriarty, Nancy Mitchell, William Wells

9th Edition

9780132998208, 0132163640, 132998203, 978-0132163644

More Books

Students also viewed these Marketing questions

Question

Which companys ratios match Column F?

Answered: 1 week ago

Question

Which companys ratios match Column I?

Answered: 1 week ago