plot.return: Plot returns of a given stock

View source: R/plot_return.R

plot.returnR Documentation

Plot returns of a given stock

Description

Plot a time series of the return of a given stock.

Usage

## S3 method for class 'return'
plot(ticker, from, to, time = "days")

Arguments

ticker

A single character variable storing the ticker of the stock to be downloaded. Note that since data are downloaded from Yahoo finance, the ticker should be the same as the ones reported on Yahoo finance. See examples.

from

A single character variable storing the starting date from which we want to download the data. The format should be "yyyy-mm-dd"

to

A single character variable storing the ending date from which we want to download the data. The format should be "yyyy-mm-dd"

time

A single character variable which indicate the desired time frame of the returns. Should be one among the following: "days" ; "weeks" ; "months" ; "quarters" ; "years". Default to "days"

Examples

 
## Not run:  
plot.return( "AAPL"  ,"2016-01-01" ,"2022-01-01" , time = "quarters")

##if you want to store a dataset in the envinroment
AAPL_ret <- plot.return( "AAPL"  ,"2016-01-01" ,"2022-01-01" , time = "quarters")

## End(Not run)

gabrielebonvicini/aaa documentation built on May 21, 2022, 12:07 a.m.