R ts()

1 개요[ | ]

R ts()
  • "Time-Series Objects → 시계열 객체"
( nums <- 101:125 )
##  [1] 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
## [20] 120 121 122 123 124 125

ts(nums, frequency=12)
##   Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
## 1 101 102 103 104 105 106 107 108 109 110 111 112
## 2 113 114 115 116 117 118 119 120 121 122 123 124
## 3 125
ts(nums, frequency=12, start=c(2000, 3))
##      Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
## 2000         101 102 103 104 105 106 107 108 109 110
## 2001 111 112 113 114 115 116 117 118 119 120 121 122
## 2002 123 124 125                    
ts(nums, frequency=12, start=c(2000, 3), end=c(2001, 7))
##      Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
## 2000         101 102 103 104 105 106 107 108 109 110
## 2001 111 112 113 114 115 116 117

ts(nums, frequency=4)
##   Qtr1 Qtr2 Qtr3 Qtr4
## 1  101  102  103  104
## 2  105  106  107  108
## 3  109  110  111  112
## 4  113  114  115  116
## 5  117  118  119  120
## 6  121  122  123  124
## 7  125
ts(nums, frequency=4, start=c(1959, 2))
##      Qtr1 Qtr2 Qtr3 Qtr4
## 1959       101  102  103
## 1960  104  105  106  107
## 1961  108  109  110  111
## 1962  112  113  114  115
## 1963  116  117  118  119
## 1964  120  121  122  123
## 1965  124  125

2 같이 보기[ | ]

3 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}