Hi all,

I am trying to draw a plot with cumsum values but each "line" has different
lengths

Ilibrary(dplyr)
library(tibble)
library(lubridate)
library(PerformanceAnalytics)
library(quantmod)
library(ggplot2)

getSymbols('TSLA')

I want to create the variables:

a<-cumsum(dailyReturn(TSLA, subset = c('2019')) )
b<-cumsum(dailyReturn(TSLA, subset = c('2020')) )
c<-cumsum(dailyReturn(TSLA, subset = c('2018')) )

Each value, on a,b,c has two columns date, and values.

The thing is I want to plot the three lines in one plot with the maximum
values of a,b,c in this case a has 252 values, and plot the other two lines
could be in the axis I should put (x <- 1:252) on the axis but I was not
able for the moment.

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to