Economics of Money and Banking / Perry G Mehrling / Ders 1

R STUDIO Tarih Fonksiyonu




.........................................................

# Tarihi çekelim
Sys.Date()

.........................................................




.........................................................
as.Date fonksiyonu

  • # kriz tarihi için tarih oluşturalım

           kriz <- as.Date("2008-09-29")


  •  dates <- c("2018-02-05","2018-02-06","2019-02-07", "2015-02-08")

            class(dates)
            character


  •  dates2 <- as.Date(dates)
            class(dates2)
            "Date"
.........................................................





.........................................................

# Tarih vektörü 

dates <- as.Date(c("2011-01-01", "2011-01-02", "2011-01-03"))

# isimleştirme fonksiyonu

names(dates) <- c("Sunday","Monday","Tuesday")
.........................................................



.........................................................
# Tarihler

dates <- as.Date(c("2011-01-01", "2011-01-02", "2011-01-03"))

# Başlangıç

origin <- as.Date("1990-01-01")


# Zaman farkını bul

dates - origin
.........................................................



.........................................................

Tarihler
dates <- as.Date(c("2014-01-02", "2014-05-03", "2014-08-04", "2014-10-17"))

# Ayları bul
months(dates)

# Günleri bul
weekdays(dates)

.........................................................


.........................................................

dates <- c("05/27/89", "07/07/09")
betterDates <- as.Date(dates,format = "%m/%d/%y")
  

.........................................................


Yorumlar