Question: I cannot figure out the R codes for the following questions. The packages I am using are: library(tidyverse) library(nycflights13) data(diamonds) load ( india04.Rdata ) I
I cannot figure out the R codes for the following questions.
The packages I am using are:
library(tidyverse) library(nycflights13) data(diamonds) load("india04.Rdata")
I am sharing exercise 1 just for the sake of giving a complete picture. I only need help with the r codes of exercise 2.


Section 1 Exercises 1. (3 pts) Filter out the Unknown category from the edattain variable in the indiae4 dataframe. Save the resulting dataframe as india04_new . Use the indiae4_new dataframe to answer the remainder of the questions in this section. 2. (7 pts) Show one example of how you could explore the distribution of each of the age , edattain , and incwage variables in indiae4_new. What do you learn? 3. (5 pts) Compare and contrast coord_cartesian() vs xlim() when zooming in on a histogram. 4. (5 pts) What does na.rm = TRUE do in max() and mean() functions? Test each command on the variable incwage in india04_new . 5. (5 pts) What is the highest income level observed in the data? 6. (5 pts) How many individuals earn exactly 200 rupees? How many earn 201? What are your thoughts on this difference?Section 2 Exercises Start from the indian4_new dataframe you created in Section 1 Exercise 1: 1. (5 pts) Use the ifelse() function to create a new variable called incwage_adj in a new dataframe called india04_new2 , where all the income values that are not between the 1st and the 99th percentile are substituted with missing values (NA). 2. (5 pts) Using indiae4_new2 , create a new variable called log_incwage_adj , that is the natural logarithm of incwage_adj . Save the resulting dataframe as a new object india04_news 3. (5 pts) Plot a histogram of log_incwage_adj from indiae4_news constructed above. How does it look different from the same histogram constructed using the natural log transformation of the incwage variable from the india04_new dataframe
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
