## R Ue1.2 exchr #setwd("C:/MH/WU/LV/OEKONOMETRIE_BA/Oe1_WS23/Chp1/DATEN/") setwd("C:/Users/hoersaal/Downloads/") # Daten einlesen (nicht ganz einfach) dat <- read.table("exchr.csv", sep=";", dec=",", header=TRUE, na.strings = "#NV", fill = TRUE, comment.char="") ## Daten anschauen dim(dat) # Es sind sehr viele Daten: 2764 Zeitpunkte, 7 Variable head(dat,4) tail(dat) require(zoo) # oo ... ordered observations date.z <- as.Date(dat$dateid01, format="%Y-%m-%d") head(date.z) # head( sapply(date.z,class) ) # bp, ffr, ... als Zeitreihe mit Zeit-Achse date.z definieren # Tagesdaten (Bankfeiertage koennten zB uebersprungen werden) bp <- zoo(dat$bp, date.z) ffr <- zoo(dat$ffr, date.z) lit <- zoo(dat$lit, date.z) usd <- zoo(dat$usd, date.z) yen <- zoo(dat$yen, date.z) # sapply(yen,class) # is.zoo(yen) plot.zoo(usd) # 4 Plots in einem op <- par(mfrow = c(2, 2)) plot.zoo(bp) plot.zoo(ffr) plot.zoo(lit) plot.zoo(yen) par(op)