Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

You have been provided with theYield Factors- All Yearswhich contains 7 variables and you are required to write codes that determine the following: Number of observations and features are in the...

1 answer below »

You have been provided with theYield Factors- All Yearswhich contains 7 variables and you are required to write codes that determine the following:

  1. Number of observations and features are in the dataset.
  2. Structure and summary of the dataset.
  3. Retrieve data for grazing land in 2016.
  4. Create a new column – “Yield_Factor” – which is a quotient of “National_Yield” (dividend) and “World_Yield” (divisor).
  5. Create an “infrastructure” dataset and use it to generate a scatter plot with “National_Yield” on the x-axis and “World_Yield” on the y-axis.
  6. Create a scatter plot of “Year_2016” with the x-axis representing “National_Yield” and the y-axis representing “World_Yield” and faceted to have one subplot per “Land_type”.
  7. Find the median national yield (National_Yield), median world yield (World_Yield) and median yield factor (Yield_Factor) within each combination of Land_type and Year.
  8. Create a line plot showing the change in median yield factor by Land_type over time

For each of the outputs [(a) - (g)] provide a discussion of your findings - a minimum of one paragraph.

1. Attach File

Answered Same Day Dec 03, 2021

Solution

Atreye answered on Dec 03 2021
110 Votes
Solution a:
Code:
li
ary("readxl")
data <- read_excel("C:/Users/Mili/Downloads/yield-factors-all-years-3psauhx3.xlsx")
data
str(data)
nrow(data)
Output:
nrow(data)
[1] 72354
Solution b:
Code
summary(data)
Output
Solution c:
Code:
data_2016 = subset.data.frame(data,Year == 2016)
Output:
A part of output is shown below:
Solution d:
Code
data$Yield_Factor=data$National_Yield/data$World_Yield
head(data,5)
Output
Solution e:
Code
data_infrastucture = subset.data.frame(data,Land_type == "Infrastructure")
ggplot(data = data_infrastucture, aes(x = National_Yield, y = World_Yield)) +...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here