Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I have this data already in long format suitable for ggplot 2 . I am using this R code to plot cumulative returns of all
I have this data already in long format suitable for ggplot I am using this R code to plot cumulative returns of all stocks in graph. Can you provide the R code. Mine keeps giving error "geompath: Each group consists of only one observation. Do you need to adjust the group aesthetic?" WHy?
ggplotmergeddatalong, aesx Date, y CumulativeReturn, color Stock
geomline
labstitle "Cumulative Returns of AAPL and TSLA",
x "Date",
y "Cumulative Returns",
color "Stock"
thememinimalte Stock CumulativeReturn
Data below:
AAPL
TSLA
AAPL
TSLA
AAPL
TSLA
AAPL
TSLA
AAPL
TSLA
AAPL
TSLA
AAPL
TSLA
AAPL
TSLA
AAPL
TSLA
AAPL
TSLA
AAPL
TSLA
AAPL
TSLA
AAPL
TSLA
AAPL
TSLA
AAPL
TSLA
AAPL
TSLA
AAPL
TSLA
AAPL
TSLA
AAPL
TSLA
AAPL
TSLA
AAPL
TSLA
AAPL
TSLA
AAPL
TSLA
AAPL
TSLA
AAPL
TSLA
AAPL
TSLA
AAPL
TSLA
AAPL
TSLA
AAPL
TSLA
AAPL
TSLA
Step 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