【发布时间】:2020-03-06 12:08:44
【问题描述】:
我有大量以百分比形式表示的兴趣时间序列。我需要将时间序列格式化为数字(百分比除以 100)而不是百分比。有这样的功能吗?
我的时间序列:
NBdata10YS=xts(x=NBdata10YS$OBS_VALUE,order.by = as.Date(as.yearmon(NBdata10YS$TIME_PERIOD)))
NBdata5YS=xts(x=NBdata5YS$OBS_VALUE,order.by = as.Date(as.yearmon(NBdata5YS$TIME_PERIOD)))
NBdata3YS=xts(x=NBdata3YS$OBS_VALUE,order.by = as.Date(as.yearmon(NBdata3YS$TIME_PERIOD)))
StatsobligasjonerNB=merge(NBdata10YS,NBdata5YS, NBdata3YS)
数据。
NBdata3YS <-
structure(c(6.03, 5.65, 5.94, 6.19, 6.03, 5.95,
5.95, 6.06, 5.89, 5.75, 5.72, 5.5, 5.33, 5.29,
5.28, 5.33, 5.5, 5.47, 5.4, 5.47 ), class = c("xts",
"zoo"), .indexCLASS = "Date", tclass = "Date",
.indexTZ = "UTC", tzone = "UTC", index =
structure(c(852076800, 854755200, 857174400, 859852800,
862444800, 865123200, 867715200, 870393600, 873072000,
875664000, 878342400, 880934400, 883612800, 886291200,
888710400, 891388800, 893980800, 896659200, 899251200,
901929600), tzone = "UTC", tclass = "Date"),
.Dim = c(20L, 1L ))
【问题讨论】:
-
如果数据
x太大,请用dput(x)或dput(head(x, 20))发布数据示例。 -
结构(c(6.03, 5.65, 5.94, 6.19, 6.03, 5.95, 5.95, 6.06, 5.89, 5.75, 5.72, 5.5, 5.33, 5.29, 5.28, 5.33, 5.5, 5.47, 5. 5.47), class= c("xts", "zoo"), .indexCLASS = "日期", tclass= "日期", .indexTZ = "UTC", tzone = "UTC", index = structure(c(852076800, 854755200,857174400,859852800,862444800,865123200,867715200,870393600,873072000,875664000,878342400,880934400,883612800,886291200,888710400,891388800,893980800,896659200,899251200,901929600),tzone = “UTC”,tclass= “日期” ), .Dim = c(20L, 1L ))
标签: r formatting xts