Question: Include both R program and R output. Consider a dataset Orange. Answer the following questions. (1) Run glimpse() function. How many variables are there in
Include both R program and R output. Consider a dataset Orange. Answer the following questions.
(1) Run glimpse() function. How many variables are there in the dataset Orange?
(2) Create a new dataset called Orange_old that is a subset of the original Orange dataset containing only trees of which age is greater than 1,000 days.
(3) How many observations do you get in the new dataset Orange_old?
(4) How many observation which the variable Tree is 1 in the dataset Orange_old. Use table() function.
(5) Use the circumference variable to find the mean circumference and store the result as avg_circumference.
(6) Create a new variable called circumference_cat, which discretizes the circumference variable into "below average" or "at or above average". Use the mutate() function from dplyr package to accomplish this.
(7) Apply table() on this new variable circumference_cat to determine how many trees are in each category.
(8) Create a new dataset called Orange_three that is a subset of the original Orange dataset containing only the variable Tree is 3.
(9) How many observations do you get in the new dataset Orange_three?
(10) Report the mean of circumference in the new dataset Orange_Three.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
