Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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.
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 YearStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started