有些資料可以按照時間先後排列,我們想描述資料點之間的關聯,判斷趨勢的型態,也想預測未來的資料點,或者想找出其他的資料跟時間數列資料的關係,這都是時間數列分析的目標。
\[\begin{equation} Y_{t}=T_{t}\times C_{t}\times S_{t}\times I_{t} \tag{2.1} \end{equation}\]
方程式(2.1)顯示,時間序列的相乘模型。我們也可以假設資料呈現相加模型如方程式(2.2):
\[\begin{equation} Y_{t}=T_{t}+C_{t}+S_{t}+I_{t} \tag{2.2} \end{equation}\]
library(fpp)
plot(as.ts(fpp::ausbeer))
Figure 2.1: 澳洲啤酒的每一季銷售量
plot(as.ts(fpp::ausair))
Figure 2.2: 澳洲註冊的航空公司的每年載客人數
\[\begin{equation} S_{t}\times I_{t}=\frac{Y_{t}}{ T_{t}\times C_{t}} \tag{3.1} \end{equation}\]
d0<-matrix(c(288.84,293.74,287.43,277.29,
311.88,309.4,283.59,282.4,
292.09,293.53,281.95,275.26,
278.45,279.57,269.94, 259.9),ncol=4,nrow=4, byrow = T)
colnames(d0)<-c('Spring','Summer','Autumn','Winter')
rownames(d0)<-c('104','105','106','107')
kbl(d0, caption="正新橡膠營業收入") %>%
kable_styling('striped',font_size = 20)
Spring | Summer | Autumn | Winter | |
---|---|---|---|---|
104 | 288.8 | 293.7 | 287.4 | 277.3 |
105 | 311.9 | 309.4 | 283.6 | 282.4 |
106 | 292.1 | 293.5 | 281.9 | 275.3 |
107 | 278.4 | 279.6 | 269.9 | 259.9 |
df<-data.frame(spring=c(288.84,293.74,287.43,277.29),
summer=c(311.88,309.4,283.59,282.47),
autumn=c(292.09,293.53,281.95,275.26),
winter=c(278.45,279.57,269.94, 259.9))
kbl(df, caption="正新橡膠資料") %>%
kable_styling('striped',font_size = 20)
spring | summer | autumn | winter |
---|---|---|---|
288.8 | 311.9 | 292.1 | 278.4 |
293.7 | 309.4 | 293.5 | 279.6 |
287.4 | 283.6 | 281.9 | 269.9 |
277.3 | 282.5 | 275.3 | 259.9 |
df<-as.matrix(df)
t.df<-t(df)
dat<-as.vector(t.df)
dat_ts<-ts(dat, frequency = 4, start=c(104,1))
kbl(dat_ts, align='l', caption = "轉換成向量的正新橡膠資料") %>%
kable_styling('striped',font_size = 20, position='left')
x |
---|
288.8 |
311.9 |
292.1 |
278.4 |
293.7 |
309.4 |
293.5 |
279.6 |
287.4 |
283.6 |
281.9 |
269.9 |
277.3 |
282.5 |
275.3 |
259.9 |
ma <- function(x, n = 4){stats::filter(x, rep(1 / n, n), sides = 2)}
dat.ma<-ma(dat)
kbl(dat.ma, align='l', caption = "四季移動平均資料") %>%
kable_styling('striped',font_size = 20, position='left')
x |
---|
NA |
292.8 |
294.0 |
293.4 |
293.8 |
294.1 |
292.5 |
286.0 |
283.1 |
280.7 |
278.2 |
277.9 |
276.2 |
273.7 |
NA |
NA |
plot.ts(dat.ma)
Figure 3.1: 四季移動平均線
macenter <- function(x, n = 2){stats::filter(x, rep(1 / n, n), sides = 2)}
dat.center<-macenter(dat.ma)
kbl(dat.center, align='l', caption = "平均移動資料")%>%
kable_styling('striped',font_size = 20, position='left')
x |
---|
NA |
293.4 |
293.7 |
293.6 |
293.9 |
293.3 |
289.3 |
284.6 |
281.9 |
279.5 |
278.1 |
277.1 |
275.0 |
NA |
NA |
NA |
plot.ts(dat.center)
Figure 3.2: 中央移動平均線
options(digits = 3)
#原始資料
df<-data.frame(spring=c(288.84,293.74,287.43,277.29),
summer=c(311.88,309.4,283.59,282.47),
autumn=c(292.09,293.53,281.95,275.26),
winter=c(278.45,279.57,269.94, 259.9))
df<-as.matrix(df)
t.df<-t(df)
revenue<-as.vector(t.df)
#中央平均
ma <- function(x, n = 4){stats::filter(x, rep(1 / n, n), sides = 2)}
dat.ma<-ma(revenue)
macenter <- function(x, n = 2){stats::filter(x, rep(1 / n, n), sides = 2)}
dat.center<-macenter(dat.ma)
MA=as.numeric(format(dat.center[2:13], digits=2))
#季節不規則
season=paste(c(rep("104",2),rep("105",4),rep("106",4),rep("107",2)),
c(3,4,rep(c(1,2,3,4),2), 1,2),
sep=".")
dat.ir <- data.table::data.table(season,revenue=revenue[3:14], MA,
irregular=as.numeric(format(revenue[3:14]/MA, digits=2)))
kbl(dat.ir, align='l', caption = "季節不規則成分")%>%
kable_styling('striped',font_size = 20, position='left')
season | revenue | MA | irregular |
---|---|---|---|
104.3 | 292 | 293 | 1.00 |
104.4 | 278 | 294 | 0.95 |
105.1 | 294 | 294 | 1.00 |
105.2 | 309 | 294 | 1.05 |
105.3 | 294 | 293 | 1.00 |
105.4 | 280 | 289 | 0.97 |
106.1 | 287 | 285 | 1.01 |
106.2 | 284 | 282 | 1.01 |
106.3 | 282 | 279 | 1.01 |
106.4 | 270 | 278 | 0.97 |
107.1 | 277 | 277 | 1.00 |
107.2 | 282 | 275 | 1.03 |
#季節不規則
year=c(rep("104",2),rep("105",4),rep("106",4),rep("107",2))
season=c("autumn","winter",rep(c("spring","summer","autumn","winter"),2), "spring","summer")
dat.irt=data.frame(year,season, x=dat.ir$irregular)
kbl(dat.irt, align='l', caption = "個別年度季節不規則成分") %>%
kable_styling('striped',font_size = 20, position='left')
year | season | x |
---|---|---|
104 | autumn | 1.00 |
104 | winter | 0.95 |
105 | spring | 1.00 |
105 | summer | 1.05 |
105 | autumn | 1.00 |
105 | winter | 0.97 |
106 | spring | 1.01 |
106 | summer | 1.01 |
106 | autumn | 1.01 |
106 | winter | 0.97 |
107 | spring | 1.00 |
107 | summer | 1.03 |
library(dplyr)
dat.irt$season<-factor(dat.irt$season, levels = c("spring","summer","autumn","winter"))
ir.table<-dat.irt %>% group_by(season)%>%
summarize(n=n(), sum=sum(x), avg=sum/n)
kbl(ir.table, align='l', caption = "季節因子")%>%
kable_styling('striped',font_size = 20, position='left')
season | n | sum | avg |
---|---|---|---|
spring | 3 | 3.01 | 1.003 |
summer | 3 | 3.09 | 1.030 |
autumn | 3 | 3.01 | 1.003 |
winter | 3 | 2.89 | 0.963 |
options(digits = 4)
S=sum(ir.table$avg)
seasonix<-4*ir.table$avg/S
Table<-rbind(ir.table$avg, seasonix)
colnames(Table)<-c("spring","summer","autumn","winter")
rownames(Table)<-c("季節因子","季節指數")
kbl(Table, align='l', caption = "季節因子與指數")%>%
kable_styling('striped',font_size = 20, position='left')
spring | summer | autumn | winter | |
---|---|---|---|---|
季節因子 | 1.003 | 1.03 | 1.003 | 0.9633 |
季節指數 | 1.003 | 1.03 | 1.003 | 0.9633 |
\[\begin{equation} Y^{'}_{t}=Y_{t}/S_{t}=T_{t}\cdot C_{t}\cdot I_{t} \tag{3.2} \end{equation}\]
df<-data.frame(spring=c(288.84,293.74,287.43,277.29),
summer=c(311.88,309.4,283.59,282.47),
autumn=c(292.09,293.53,281.95,275.26),
winter=c(278.45,279.57,269.94, 259.9))
df<-as.matrix(df)
t.df<-t(df)
revenue<-as.vector(t.df)
yprime<-revenue/seasonix
DF<-data.frame(revenue, seasonix, yprime)
kbl(DF, align='l', caption = "消除季節因素的營業收入")%>%
kable_styling('striped',font_size = 20, position='left')
revenue | seasonix | yprime |
---|---|---|
288.8 | 1.0033 | 287.9 |
311.9 | 1.0300 | 302.8 |
292.1 | 1.0033 | 291.1 |
278.4 | 0.9633 | 289.0 |
293.7 | 1.0033 | 292.8 |
309.4 | 1.0300 | 300.4 |
293.5 | 1.0033 | 292.6 |
279.6 | 0.9633 | 290.2 |
287.4 | 1.0033 | 286.5 |
283.6 | 1.0300 | 275.3 |
281.9 | 1.0033 | 281.0 |
269.9 | 0.9633 | 280.2 |
277.3 | 1.0033 | 276.4 |
282.5 | 1.0300 | 274.2 |
275.3 | 1.0033 | 274.3 |
259.9 | 0.9633 | 269.8 |
\[\begin{equation} Y^{'}_{t}=Y_{t}/S_{t}=\alpha+\beta\cdot t+\epsilon \tag{3.3} \end{equation}\]
t<-c(1:16)
DFm<-data.frame(yprime, t)
m1 <- lm(yprime ~ t, data=DFm)
DFols<-summary(m1)
stargazer::stargazer(m1, type = "html",
title = "消除季節因素的營業收入的迴歸模型",
header = FALSE, style='apsr',
single.row = TRUE)
yprime | |
t | -1.737*** (0.291) |
Constant | 300.000*** (2.812) |
N | 16 |
R2 | 0.718 |
Adjusted R2 | 0.698 |
Residual Std. Error | 5.363 (df = 14) |
F Statistic | 35.660*** (df = 1; 14) |
p < .1; p < .05; p < .01 |
t_108<-c(17:20)
yprimenew=300-1.737*t_108
pred=seasonix[1:4]*yprimenew
season=c("spring","summer","autumn","winter")
predt<-data.frame(season, y_prime=yprime[13:16], season_t=seasonix[1:4], predict=pred)
kbl(predt, align='l', caption = "108年的營業收入的預測值") %>%
kable_styling('striped',font_size = 20, position='left' )
season | y_prime | season_t | predict |
---|---|---|---|
spring | 276.4 | 1.0033 | 271.4 |
summer | 274.2 | 1.0300 | 276.8 |
autumn | 274.3 | 1.0033 | 267.9 |
winter | 269.8 | 0.9633 | 255.5 |
\[y_{t}=\beta_{0}+t\beta_{1}+\epsilon_{t},\quad \epsilon_{t}\sim N(0,\sigma^2)\]
set.seed(02138)
t=c(1:24)
Y=0.5+t*2.4
plot(t, Y, col='#FF11AA', pch=20, ylim=c(0,40))
abline(lm(Y~t), lty=1, col='#11CC11')
axis(1, c(1:24))
Figure 4.1: 24個時間點的趨勢圖1
set.seed(02138)
t=c(1:24)
Y=0.5 + t*2.4 + rnorm(24, 2, 5) #time series
Yseries<-ts(Y) #time series
plot.ts(Yseries, col='#DD1111', pch=20,
ylim=c(0,60), lwd=1.5)
Y1=0.5 + t*2.4 #no noisy
points(t, Y1, col='#201BCC', lwd=1.5, type='l')
axis(1, c(1:24))
legend(1, 62, lty=c(1,1,1),c('time series',
'trend'), bty='n', col=c('#DD1111','#201BCC'))
Figure 4.2: 24個時間點的趨勢圖2
set.seed(02138)
t=c(1: 24)
Y=0.5 + t*2.4 + rnorm(24, 2, 5) #time series
Yseries<-ts(Y) #time series
plot.ts(Yseries, col='#DD1111', pch=20,
ylim=c(0,60), lwd=1.5)
Y1=0.5 + t*2.4 #no noisy
points(t, Y1, col='#201BCC', lwd=1.5, type='l')
abline(lm(Y ~ t), lty=2, col='#312C00', lwd=1.5)
axis(1, c(1:24))
legend(1, 62, lty=c(1,1,2),c('time series',
'trend','linear estimate'), bty='n', col=c('#DD1111','#201BCC', '#312C00'))
Figure 4.3: 24個時間點的趨勢圖3
set.seed(02138)
t=c(1:24)
Y=0.5 + t*2.4 + rnorm(24, 2, 5) #time series
Yseries<-ts(Y) #time series
plot.ts(Yseries, col='#33EE11', pch=21, type='p',
ylim=c(0,60), lwd=1.5)
points(t[c(4:10)], Yseries[c(4:10)], col='#DD1111', pch=16, type='p')
Y1=0.5 + t*2.4 #no noisy
points(t, Y1, col='#201BCC', lwd=1.5, type='l')
abline(lm(Y[c(4:10)] ~ t[c(4:10)]), lty=2, col='#312C00', lwd=1.5)
axis(1, c(1:24))
legend(1, 62, lty=c(1,1,2),c('time series',
'trend','linear estimate'), bty='n', col=c('#DD1111','#201BCC', '#312C00'))
Figure 4.4: 24個時間點的趨勢圖3
kings <- scan("http://robjhyndman.com/tsdldata/misc/kings.dat", skip=3)
t<-c(1:42)
plot(t, kings, type='l', col='#DD1111', lwd=1.5)
abline(lm(kings~t), col='#200BCC', lty=2, lwd=1.5)
Figure 4.5: 英國國王的死亡年齡趨勢圖1
kings <- scan("http://robjhyndman.com/tsdldata/misc/kings.dat",skip=3)
kingsseries <-ts(kings)
plot.ts(kingsseries, type='l', col='#DD1111', lwd=1.5)
abline(lm(kings ~ t), col='#0AC200', add=T,
lty=2, lwd=1.5)
Figure 4.6: 英國國王的死亡年齡趨勢圖2
set.seed(02138)
t=c(1:24)
e=rnorm(24, 2, 5)
Y=0.5 + t*2.4 + e #time series
Yseries<-ts(Y) #time series
plot.ts(Yseries, col='#22AACC', type='l',
ylim=c(0,60), lwd=1.5, ylab=bquote(y[i]-t*beta))
points(t, Y - 2.4 * t - e, col='#DD1111', type='l')
axis(1, c(1:24))
Figure 4.7: 24個時間點的趨勢圖4
\[\epsilon_{t}=\rho\epsilon_{t-1}+u_{t},\quad -1<\rho<1\]
\[y_{t}=y_{t-1}\phi_{1}+\epsilon_{t}\]
\[\begin{align*} y_{t}&=y_{t-1}\phi_{1} +\epsilon_{t}\\ &=(y_{t-2}\phi_{1}+\epsilon_{t-1})\phi_{1}+\epsilon_{t}\\ &= y_{t-2}\phi_{1}^2+\epsilon_{t-1}\phi_{1}+\epsilon_{t}\\ &=(y_{t-3}\phi_{1}+\epsilon_{t-2})\phi_{1}^2+\epsilon_{t-1}\phi_{1}+\epsilon_{t}\\ &\ldots \rm{substitue} \hspace{.2em}\rm{through}\hspace{.2em}y_{t-k}\\ &=y_{t-k}\phi_{1}^k+\sum\limits_{j=0}^{k-1}\epsilon_{t-j}\phi^{j}\\ &\ldots \rm{substitue} \hspace{.2em}\rm{through}\hspace{.2em}y_{t-\infty}\\ &=\sum\limits_{j=0}^{\infty}\epsilon_{t-j}\phi^{j} \end{align*}\]
set.seed(02138)
y <- arima.sim(list(order=c(1,0,0),
ar = 0.5,
ma = NULL), n=200)
y=ts(y)
plot.ts(y, col='#CC22AA')
Figure 4.8: ARIMA時間數列圖1
adolph='http://faculty.washington.edu/cadolph/panEssex/makeTS.R'
source(adolph)
set.seed(02138)
Y <- makeTS(n=200,
ar= 0, #phi=0
ma= NULL,
trend=0,
seasons=c(0,0,0,0,0,0,0,0,0,0,0,0),
adjust=c('level'),
varY = 0, #Error Term variance
initY = 0,
initE = 0,
burnin = 10)
Y1 <- makeTS(n=200,
ar= 0.5, #phi=0
ma= NULL,
trend=0,
seasons=c(0,0,0,0,0,0,0,0,0,0,0,0),
adjust=c('level'),
varY = 1, #Error Term variance
initY = 0,
initE = 0,
burnin = 10)
plot.ts(Y1, col='#CC22AA')
t<-c(1:200)
lines(t, Y, type='l', col='#123CDA', lty=2)
Figure 4.9: ARIMA時間數列圖2
\[\begin{align*} \rm{ACF}_{j}&=\rm{cor}(y_{t},y_{t-j})=\frac{cov(y_{t},y_{t-j})}{\sqrt{var(y)}\sqrt{var(y)}} \\ &=\frac{cov(y_{t},y_{t-j})}{var(y)} \end{align*}\]
R
可以畫圖:acf(Y1)
pacf(Y1)
\[\begin{align*} y_{t}&=y_{t-1}\phi_{1}+y_{t-2}\phi_{2}+\ldots+y_{t-p}\phi_{p}+\epsilon_{t} \end{align*}\]
\[Y_{t}=\beta_{0}+\beta_{1}Y_{t-1}+\beta_{2}Y_{t-2}+\ldots+\beta_{p}Y_{t-p}+\epsilon_{t}\]
\[Y_{t}=\epsilon_{t-1}\phi_{1}+\epsilon_{t-2}\phi_{2}+\ldots+\epsilon_{t-q}\phi_{q}+\epsilon_{t}\]
set.seed(02138)
y <- arima.sim (list(order=c(0,0,1),
ar = NULL,
ma = c(0.57)),
n= 1000)
plot(y, col='#DD22AA')
acf(y)
pacf(y)
adolph='http://faculty.washington.edu/cadolph/panEssex/makeTS.R'
source(adolph)
set.seed(02138)
Y <- makeTS(n= 120,
ar= c(rep(0,11),0.85), #phi=0.85
ma= NULL,
trend=0.001,
seasons=c(0,0,0,0,0,
0,0,0,0,0,
0,0),
adjust=c('level'),
x = NULL,
beta = NULL,
varY = 1, #Error Term variance
initY = 0,
initE = 0,
burnin = 10)
plot.ts(Y, col='#CC22AA')
Figure 4.10: 週期性時間數列圖1
Y.ts<-ts(Y, start=1, frequency = 12)
t<-c(1: 12)
plot(t, Y.ts[1:12], type='n')
dt <- matrix(Y.ts, ncol=12, nrow=length(Y.ts)/12,
byrow=TRUE)
for (i in 1: 10){
lines(t, dt[i,], type='l', lty=i, lwd=1.5,
col=RColorBrewer::brewer.pal(10, 'BuPu')[i])
}
Figure 4.11: 週期性時間數列圖2
plot.ts(dat)
Figure 5.1: 正新橡膠營業收入趨勢
library(TTR)
datsma3 <-TTR::SMA(dat, n=4)
plot.ts(datsma3)
Figure 5.2: TTR產出的四季移動平均線
library(forecast)
trend_dat<-forecast::ma(dat_ts, order=4, centre=T)
kbl(trend_dat, align='l', caption = "四季移動平均值")%>%
kable_styling('striped',font_size = 20, position='left')
x |
---|
NA |
NA |
293.4 |
293.7 |
293.6 |
293.9 |
293.3 |
289.3 |
284.6 |
281.9 |
279.5 |
278.1 |
277.1 |
275.0 |
NA |
NA |
plot(as.ts(trend_dat))
Figure 5.3: forecast產出的移動平均線與長期趨勢
plot(as.ts(dat_ts))
lines(trend_dat, col='tomato')
Figure 5.4: forecast產出的移動平均線與長期趨勢
xt<-decompose(dat_ts, 'multiplicative')
kbl(data.frame(xt$trend), caption='decompose功能')%>%
kable_styling('striped', font_size=18, position='center', full_width = F)
xt.trend |
---|
NA |
NA |
293.4 |
293.7 |
293.6 |
293.9 |
293.3 |
289.3 |
284.6 |
281.9 |
279.5 |
278.1 |
277.1 |
275.0 |
NA |
NA |
kbl(data.frame(xt$figure), caption='figure')%>%
kable_styling('striped', font_size=18, position='center', full_width = F)
xt.figure |
---|
1.0048 |
1.0297 |
1.0028 |
0.9628 |
kbl(data.frame(xt$seasonal), caption='Seasonal')%>%
kable_styling('striped',font_size=18, position='center', full_width = F)
xt.seasonal |
---|
1.0048 |
1.0297 |
1.0028 |
0.9628 |
1.0048 |
1.0297 |
1.0028 |
0.9628 |
1.0048 |
1.0297 |
1.0028 |
0.9628 |
1.0048 |
1.0297 |
1.0028 |
0.9628 |
plot(xt)
x <- zoo(rnorm(5), as.Date("2021-02-01")+seq(1,10, by=2) )
kbl(x) %>% kable_styling('striped',font_size = 18)
x | |
---|---|
2021-02-02 | 1.2864 |
2021-02-04 | 0.1515 |
2021-02-06 | 0.1596 |
2021-02-08 | -0.1517 |
2021-02-10 | -0.3866 |
library(AER);library(quantmod)
data('NYSESW')
NYSESW <- xts(Delt(NYSESW))
plot(as.zoo(NYSESW),
col = "steelblue",
lwd = 2,
ylab = "Percent per Day",
xlab = "Date",
main = "New York Stock Exchange Composite Index",
cex.main = 1)
#load libraries
library(readxl)
#specify path
usquar<-here::here('data','us_Macro_Quarterly.xlsx')
# load US macroeconomic data
USMacroSWQ <- read_xlsx(usquar,
sheet = 1,
col_types = c("text", rep("numeric", 9)))
# format date column
USMacroSWQ$...1 <- zoo::as.yearqtr(USMacroSWQ$...1, format = "%Y:0%q")
# adjust column names
colnames(USMacroSWQ) <- c("Date", "GDPC96", "JAPAN_IP", "PCECTPI", "GS10", "GS1", "TB3MS", "UNRATE", "EXUSUK", "CPIAUCSL")
# GDP series as xts object
GDP <- xts(USMacroSWQ$GDPC96, USMacroSWQ$Date)["1960::2013"]
# GDP growth series as xts object
GDPGrowth <- xts(400 * log(GDP/stats::lag(GDP)))
plot(log(as.zoo(GDP)),
col = "steelblue",
lwd = 2,
ylab = "Logarithm",
xlab = "Date",
main = "U.S. Quarterly Real GDP")
Figure 6.1: GDP成長曲線
plot(as.zoo(GDPGrowth),
col = "steelblue",
lwd = 2,
ylab = "Logarithm",
xlab = "Date",
main = "U.S. Real GDP Growth Rates")
Figure 6.2: GDP成長率之成長曲線
# compute logarithms, annual growth rates and 1st lag of growth rates
quants <- function(series) {
s <- series
return(
data.frame("Level" = s,
"Logarithm" = log(s),
"AnnualGrowthRate" = 400 * log(s / stats::lag(s)),
"1stLagAnnualGrowthRate" = stats::lag(400 * log(s / stats::lag(s))))
)
}
# obtain a data.frame with level, logarithm, annual growth rate and its 1st lag of GDP
Qd<-quants(GDP["2011-07::2013-01"])
kbl(Qd, caption='GDP自然對數') %>%
kable_styling(font_size = 20, position='left' )
Level | Logarithm | AnnualGrowthRate | X1stLagAnnualGrowthRate | |
---|---|---|---|---|
2011 Q3 | 15062 | 9.620 | NA | NA |
2011 Q4 | 15242 | 9.632 | 4.7518 | NA |
2012 Q1 | 15382 | 9.641 | 3.6422 | 4.7518 |
2012 Q2 | 15428 | 9.644 | 1.1972 | 3.6422 |
2012 Q3 | 15534 | 9.651 | 2.7470 | 1.1972 |
2012 Q4 | 15540 | 9.651 | 0.1453 | 2.7470 |
2013 Q1 | 15584 | 9.654 | 1.1392 | 0.1453 |
R
的資料庫中,lynx這筆資料記錄西元1821至1934年的加拿大西北部馬更些(Mackenzie)流域附近每年的山貓數量。請嘗試畫出加拿大山貓(lynx)這筆資料的時間數列圖、自我相關函數圖,以及淨自我相關函數圖。
d2019<-c(41,42,43,44)
kbl(d2019, caption='某地區2019年資料') %>%
kable_styling(position='center',full_width = F, font_size = 18)
x |
---|
41 |
42 |
43 |
44 |
最後更新日期: 06/17/2021