Yenilenebilir Enerji Grubu, Inc. (REGI)
library(quantmod)
## Zorunlu paket yükleniyor: xts
## Zorunlu paket yükleniyor: zoo
##
## Attaching package: 'zoo'
## The following objects are masked from 'package:base':
##
## as.Date, as.Date.numeric
## Zorunlu paket yükleniyor: TTR
## Registered S3 method overwritten by 'quantmod':
## method from
## as.zoo.data.frame zoo
getSymbols("REGI")
## '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] "REGI"
dim(REGI)
## [1] 2545 6
head(REGI)
## REGI.Open REGI.High REGI.Low REGI.Close REGI.Volume REGI.Adjusted
## 2012-01-19 10.10 10.29 9.90 10.10 3599000 10.10
## 2012-01-20 10.10 10.10 9.50 9.73 440100 9.73
## 2012-01-23 9.61 9.64 8.65 9.49 278900 9.49
## 2012-01-24 9.47 9.86 9.47 9.85 77800 9.85
## 2012-01-25 9.80 10.00 9.80 9.82 76800 9.82
## 2012-01-26 10.04 10.04 9.77 9.81 28100 9.81
tail(REGI)
## REGI.Open REGI.High REGI.Low REGI.Close REGI.Volume REGI.Adjusted
## 2022-02-18 34.15 34.71 33.20 33.40 475600 33.40
## 2022-02-22 33.96 34.10 32.54 32.62 659000 32.62
## 2022-02-23 40.11 41.65 38.25 41.11 3357400 41.11
## 2022-02-24 39.80 43.77 39.22 43.06 2102900 43.06
## 2022-02-25 42.47 43.95 42.44 43.81 1603900 43.81
## 2022-02-28 60.94 61.61 60.25 61.50 12802700 61.50
chartSeries(REGI)

chartSeries(REGI, theme="white")

3D Systems Corporation (DDD)
library(quantmod)
getSymbols("DDD")
## [1] "DDD"
dim(DDD)
## [1] 3816 6
head(DDD)
## DDD.Open DDD.High DDD.Low DDD.Close DDD.Volume DDD.Adjusted
## 2007-01-03 5.346667 5.346667 4.986667 5.070000 381600 5.070000
## 2007-01-04 5.070000 5.070000 4.793333 4.926667 394800 4.926667
## 2007-01-05 4.893333 4.896667 4.826667 4.833333 329400 4.833333
## 2007-01-08 4.810000 4.856667 4.773333 4.846667 369900 4.846667
## 2007-01-09 4.816667 4.890000 4.760000 4.860000 312600 4.860000
## 2007-01-10 4.836667 5.016667 4.816667 4.986667 177600 4.986667
tail(DDD)
## DDD.Open DDD.High DDD.Low DDD.Close DDD.Volume DDD.Adjusted
## 2022-02-18 18.23 18.37 17.38 17.59 1439600 17.59
## 2022-02-22 16.95 17.68 16.84 17.09 1454100 17.09
## 2022-02-23 17.23 17.83 16.40 16.44 1581400 16.44
## 2022-02-24 15.50 17.28 15.38 17.26 2487300 17.26
## 2022-02-25 17.25 17.45 16.63 17.44 1313200 17.44
## 2022-02-28 17.38 18.08 17.23 17.82 3418200 17.82
chartSeries(DDD)

chartSeries(DDD, theme="white")

Eczacılık Ürünleri (Reçetesiz İlaçlar) Harcama Fiyat Endeksi
getSymbols("PHPRDRPIHCSA",src="FRED")
## [1] "PHPRDRPIHCSA"
chartSeries(PHPRDRPIHCSA,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")

Sağlık Harcamaları Fiyat Endeksi, MEPS Hesap
getSymbols("HLTHSCPIMEPS",src="FRED")
## [1] "HLTHSCPIMEPS"
chartSeries(HLTHSCPIMEPS,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")

Ölüm oranı, 5 yaş altı (1.000 canlı doğumda)
library(WDI)
dk = WDI(indicator='SH.DYN.MORT', country=c('MX','TR','BR'), start=2010, end=2019)
head(dk)
## iso2c country SH.DYN.MORT year
## 1 BR Brazil 14.9 2019
## 2 BR Brazil 15.2 2018
## 3 BR Brazil 15.4 2017
## 4 BR Brazil 16.7 2016
## 5 BR Brazil 15.9 2015
## 6 BR Brazil 16.3 2014
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:xts':
##
## first, last
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
dk <- dk %>%
rename(ulkekodu = 1,
ulke = 2,
ölüm = 3,
sene = 4)
library(reshape2)
data_genis <- dcast(dk, sene ~ ulke, value.var="ölüm")
head(data_genis)
## sene Brazil Mexico Turkey
## 1 2010 18.6 19.2 18.1
## 2 2011 17.9 18.5 16.9
## 3 2012 17.2 17.9 15.8
## 4 2013 16.7 17.3 14.7
## 5 2014 16.3 16.8 13.8
## 6 2015 15.9 16.2 13.0
tsveri <- ts(data_genis, start=2010, frequency=1)
head(tsveri)
## sene Brazil Mexico Turkey
## [1,] 2010 18.6 19.2 18.1
## [2,] 2011 17.9 18.5 16.9
## [3,] 2012 17.2 17.9 15.8
## [4,] 2013 16.7 17.3 14.7
## [5,] 2014 16.3 16.8 13.8
## [6,] 2015 15.9 16.2 13.0
library(ggplot2)
library(ggfortify)
autoplot(tsveri[,"Turkey"]) +
ggtitle("Türkiye'nin ölüm oranı") +
xlab("Sene") +
ylab("")

plot(tsveri[,2:4])

data_uzun <- melt(data_genis, id.vars = "sene")
ggplot(data_uzun,
aes(x = sene,
y = value,
col = variable)) +
geom_line()

Mal ve hizmet ihracatı (GSYİH’nın yüzdesi)
library(WDI)
dk = WDI(indicator='NE.EXP.GNFS.ZS', country=c('MX','TR','BR'), start=2010, end=2019)
head(dk)
## iso2c country NE.EXP.GNFS.ZS year
## 1 BR Brazil 14.10536 2019
## 2 BR Brazil 14.63500 2018
## 3 BR Brazil 12.51897 2017
## 4 BR Brazil 12.46668 2016
## 5 BR Brazil 12.90019 2015
## 6 BR Brazil 11.01194 2014
library(dplyr)
dk <- dk %>%
rename(ulkekodu = 1,
ulke = 2,
malvehızmet = 3,
sene = 4)
library(reshape2)
data_genis <- dcast(dk, sene ~ ulke, value.var="malvehızmet")
head(data_genis)
## sene Brazil Mexico Turkey
## 1 2010 10.86558 29.69766 21.19413
## 2 2011 11.58251 31.03671 22.99370
## 3 2012 11.87754 32.26557 24.36088
## 4 2013 11.74223 31.30565 23.79301
## 5 2014 11.01194 31.87344 25.20554
## 6 2015 12.90019 34.52489 24.53128
tsveri <- ts(data_genis, start=2010, frequency=1)
head(tsveri)
## sene Brazil Mexico Turkey
## [1,] 2010 10.86558 29.69766 21.19413
## [2,] 2011 11.58251 31.03671 22.99370
## [3,] 2012 11.87754 32.26557 24.36088
## [4,] 2013 11.74223 31.30565 23.79301
## [5,] 2014 11.01194 31.87344 25.20554
## [6,] 2015 12.90019 34.52489 24.53128
library(ggplot2)
library(ggfortify)
autoplot(tsveri[,"Turkey"]) +
ggtitle("Türkiye'nin mal ve hizmet oranı") +
xlab("Sene") +
ylab("")

plot(tsveri[,2:4])

data_uzun <- melt(data_genis, id.vars = "sene")
ggplot(data_uzun,
aes(x = sene,
y = value,
col = variable)) +
geom_line()
