Question: R coding Please Help Homework 2 ggplot2 rocks! DA 6233 2022-10-05 Homework 2 is all about usingggplot2. You will usetech_financials.csvdata set you have used previously

R coding Please Help

Homework 2

ggplot2 rocks!

DA 6233 2022-10-05

Homework 2 is all about usingggplot2. You will usetech_financials.csvdata set you have used previously in Homework 1.

Q4 (2 points)

Compare profit margins (pr_margin) of the following six companies - Apple, Tesla, Meta, Twitter, Amazon, and Qualcomm - over the full sample period. Usefyearon the X axis.fyearis the fiscal year.

Here I give you the code to get the data set in the required form.

d1 % filter(sale > 0) %>% mutate(conm = stringr::str_to_title(conm), # Converts the string to title case datadate = lubridate::ymd(datadate)) # Convert datadate into a date variabled1_4 % filter(tic %in% c("AAPL", "TSLA", "META", "TWTR", "AMZN", "QCOM")) %>% mutate(pr_margin = oibdp / sale, fyear = as.Date(paste(fyear, "12", "31", sep = "-")))

Now used1_4code to produce the following plot. How could I code this? Please Help, Thank you.

R coding Please HelpHomework 2ggplot2 rocks!DA 6233 2022-10-05Homework 2 is all about

Now use d1_4 to produce the following plot. Hint: Note that all the panels in the facetplot have text on the X axis. This is not the default behavior. Check out the "scales" argument inside facet_wrap(). Amazon.com Inc Apple Inc Meta Platforms Inc 50% 0% -50% -100% 2012 2014 2016 2018 2020 2022 2012 2014 2016 2018 2020 2022 2012 2014 2016 2018 2020 2022 Profit Margin Qualcomm Inc Tesla Inc Twitter Inc 50% 0% -50% -100% 2012 2014 2016 2018 2020 2022 2012 2014 2016 2018 2020 2022 2012 2014 2016 2018 2020 2022 Fiscal Year

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 Mathematics Questions!