library(quantmod)
## Loading required package: xts
## Loading required package: zoo
##
## Attaching package: 'zoo'
## The following objects are masked from 'package:base':
##
## as.Date, as.Date.numeric
## Loading required package: TTR
## Registered S3 method overwritten by 'quantmod':
## method from
## as.zoo.data.frame zoo
getSymbols("TWTR")
## 'getSymbols' currently uses auto.assign=TRUE by default, but will
## use auto.assign=FALSE in 0.5-0. You will still be able to use
## 'loadSymbols' to automatically load data. getOption("getSymbols.env")
## and getOption("getSymbols.auto.assign") will still be checked for
## alternate defaults.
##
## This message is shown once per session and may be disabled by setting
## options("getSymbols.warning4.0"=FALSE). See ?getSymbols for details.
## [1] "TWTR"
dim(TWTR)
## [1] 2093 6
head(TWTR)
## TWTR.Open TWTR.High TWTR.Low TWTR.Close TWTR.Volume TWTR.Adjusted
## 2013-11-07 45.10 50.09 44.00 44.90 117701600 44.90
## 2013-11-08 45.93 46.94 40.69 41.65 27925300 41.65
## 2013-11-11 40.50 43.00 39.40 42.90 16113900 42.90
## 2013-11-12 43.66 43.78 41.83 41.90 6316700 41.90
## 2013-11-13 41.03 42.87 40.76 42.60 8688300 42.60
## 2013-11-14 42.34 45.67 42.24 44.69 11099400 44.69
tail(TWTR)
## TWTR.Open TWTR.High TWTR.Low TWTR.Close TWTR.Volume TWTR.Adjusted
## 2022-02-23 33.25 33.46 32.42 32.760 15102100 32.760
## 2022-02-24 31.30 35.07 31.30 34.980 22551000 34.980
## 2022-02-25 35.12 35.30 34.13 35.290 15394900 35.290
## 2022-02-28 34.95 36.05 34.85 35.550 17962000 35.550
## 2022-03-01 35.51 36.13 34.71 35.560 17948000 35.560
## 2022-03-02 35.77 35.75 34.13 34.705 16063068 34.705
chartSeries(TWTR)
library(quantmod)
getSymbols("UPS")
## [1] "UPS"
dim(UPS)
## [1] 3818 6
tail(UPS)
## UPS.Open UPS.High UPS.Low UPS.Close UPS.Volume UPS.Adjusted
## 2022-02-23 209.47 210.960 204.17 204.48 2836000 204.48
## 2022-02-24 200.11 207.420 199.05 207.19 3347000 207.19
## 2022-02-25 207.24 211.590 206.87 209.95 2657100 209.95
## 2022-02-28 206.17 210.930 204.54 210.42 3536400 210.42
## 2022-03-01 209.47 210.610 203.79 205.58 2986100 205.58
## 2022-03-02 205.90 213.365 205.74 211.35 2093080 211.35
chartSeries(UPS)
library(quantmod)
getSymbols("FPCPITOTLZGTUR",src="FRED")
## [1] "FPCPITOTLZGTUR"
chartSeries(FPCPITOTLZGTUR,theme="white")
getFX("USD/TRY",from="2020-01-01")
## Warning in doTryCatch(return(expr), name, parentenv, handler): Oanda only
## provides historical data for the past 180 days. Symbol: USD/TRY
## [1] "USD/TRY"
chartSeries(USDTRY,theme="white")
library(quantmod)
getSymbols("TRINTDEXR",src="FRED")
## [1] "TRINTDEXR"
chartSeries(TRINTDEXR,theme="white")
getFX("USD/TRY",from="2022-03-01")
## [1] "USD/TRY"
You can also embed plots, for example:
Note that the echo = FALSE parameter was added to the
code chunk to prevent printing of the R code that generated the
plot.