R語言
time
位於 stats
包(package)。 說明
time
創建對時間序列進行采樣的時間向量。
cycle
給出每個觀察周期中的位置。
frequency
返回每單位時間的樣本數,deltat
返回觀察之間的時間間隔(請參閱 ts
)。
用法
time(x, ...)
## Default S3 method:
time(x, offset = 0, ts.eps = getOption("ts.eps"), ...)
cycle(x, ...)
frequency(x, ...)
deltat(x, ...)
參數
x |
單變量或多變量時間序列,或者向量或矩陣。 |
offset |
可用於指示在時間單位內何時進行采樣。 |
ts.eps |
時間序列比較容差,在 |
... |
未來方法的額外參數。 |
細節
這些都是通用函數,將使用 x
的 tsp
屬性(如果存在)。 time
和 cycle
具有類 ts
的方法,可將結果強製傳遞給該類。
time()
round()
s 值接近整數,即接近於ts.eps
, 自從R4.3.0。對於以前的行為,您可以使用以下方式調用它ts.eps = 0
.
例子
require(graphics)
cycle(presidents)
# a simple series plot
plot(as.vector(time(presidents)), as.vector(presidents), type = "l")
參考
Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) The New S Language. Wadsworth & Brooks/Cole.
也可以看看
date
表示時鍾時間,system.time
表示 CPU 使用情況。
相關用法
- R tsdiag 時間序列擬合的診斷圖
- R terms 示範條款
- R ts.plot 繪製多個時間序列
- R ts 時間序列對象
- R terms.object 術語對象的說明
- R tsSmooth 對時間序列使用固定間隔平滑
- R termplot 繪製回歸項
- R ts-methods 時間序列對象的方法
- R toeplitz 創建對稱和非對稱托普利茨矩陣
- R ts.union 綁定兩個或多個時間序列
- R tsp 類時間序列對象的 Tsp 屬性
- R t.test 學生 t 檢驗
- R terms.formula 從公式構造術語對象
- R stlmethods STL 對象的方法
- R medpolish 矩陣的中值波蘭(穩健雙向分解)
- R naprint 調整缺失值
- R summary.nls 總結非線性最小二乘模型擬合
- R summary.manova 多元方差分析的匯總方法
- R formula 模型公式
- R nls.control 控製 nls 中的迭代
- R aggregate 計算數據子集的匯總統計
- R deriv 簡單表達式的符號和算法導數
- R kruskal.test Kruskal-Wallis 秩和檢驗
- R quade.test 四方測試
- R decompose 移動平均線的經典季節性分解
注:本文由純淨天空篩選整理自R-devel大神的英文原創作品 Sampling Times of Time Series。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。