Question: Please help with R language. Please note: * Questions with (Q) require a brief written response * Questions with (C) require that you report the

Please help with R language. Please note: * Questions with (Q) require a brief written response * Questions with (C) require that you report the code used to answer the question

Please help with R language. Please note: * Questions with (Q) require

Remember our old friend mtcars? The dplyr package includes an expanded number of datasets to play around with, including a dataset of Star Wars characters called "starwars. 1. Take a look at the starwars dataset. (With dplyr loaded, you can just type "starwars".) Does this dataset follow the guidelines of "tidy" data? Why or why not? (Q) 2. Using ggplot, make a bar chart showing how many characters are from each homeworld in the dataset. What is the code, and what does your chart look like? (You can take a screenshot, or use the Export" drop down menu to save as an image or copy to clipboard.) (Hint: to achieve this, you only need to use ggplot() with geom_bar()) (C) 3. The chart looks very cluttered, as it is now. If our goal here is to look at homeworlds that lots of Star Wars characters have come from, we might want to filter out planets that are the homeworld of only one character. Note: to do this, we will need several dplyr functions, which we will then pass to ggplot() to create the bar plot. Below is some code that would accomplish this goal if it was in the correct order. Reorder the code block to create a bar chart that only includes homeworlds that occur more than once in the dataset. (C) O filter (count>=2)%>% ggplot(aes (x=homeworld, y=count))+ group_by (homeworld)%>% starwars%>% geom_bar(stat="identity") summarise (count=n())%>% Remember our old friend mtcars? The dplyr package includes an expanded number of datasets to play around with, including a dataset of Star Wars characters called "starwars. 1. Take a look at the starwars dataset. (With dplyr loaded, you can just type "starwars".) Does this dataset follow the guidelines of "tidy" data? Why or why not? (Q) 2. Using ggplot, make a bar chart showing how many characters are from each homeworld in the dataset. What is the code, and what does your chart look like? (You can take a screenshot, or use the Export" drop down menu to save as an image or copy to clipboard.) (Hint: to achieve this, you only need to use ggplot() with geom_bar()) (C) 3. The chart looks very cluttered, as it is now. If our goal here is to look at homeworlds that lots of Star Wars characters have come from, we might want to filter out planets that are the homeworld of only one character. Note: to do this, we will need several dplyr functions, which we will then pass to ggplot() to create the bar plot. Below is some code that would accomplish this goal if it was in the correct order. Reorder the code block to create a bar chart that only includes homeworlds that occur more than once in the dataset. (C) O filter (count>=2)%>% ggplot(aes (x=homeworld, y=count))+ group_by (homeworld)%>% starwars%>% geom_bar(stat="identity") summarise (count=n())%>%

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!