-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathindex.html
More file actions
302 lines (275 loc) · 28.4 KB
/
index.html
File metadata and controls
302 lines (275 loc) · 28.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html lang="en-GB">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Feature Extraction and Statistics for Time Series • feasts</title>
<!-- favicons --><link rel="icon" type="image/png" sizes="48x48" href="favicon-48x48.png">
<link rel="icon" type="”image/svg+xml”" href="favicon.svg">
<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png">
<link rel="icon" sizes="any" href="favicon.ico">
<link rel="manifest" href="site.webmanifest">
<!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js" integrity="sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==" crossorigin="anonymous" referrerpolicy="no-referrer"></script><!-- Bootstrap --><link href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/cosmo/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous">
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script><!-- bootstrap-toc --><link rel="stylesheet" href="bootstrap-toc.css">
<script src="bootstrap-toc.js"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous">
<!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script><!-- pkgdown --><link href="pkgdown.css" rel="stylesheet">
<script src="pkgdown.js"></script><meta property="og:title" content="Feature Extraction and Statistics for Time Series">
<meta property="og:description" content="Provides a collection of features, decomposition methods, statistical summaries and graphics functions for the analysing tidy time series data. The package name feasts is an acronym comprising of its key features: Feature Extraction And Statistics for Time Series.">
<meta property="og:image" content="https://feasts.tidyverts.org/logo.png">
<!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]--><!-- Privacy-friendly analytics by Plausible --><script async src="https://track.mitchelloharawild.com/js/pa-cnTu3Wiw7njh9ymkdb3It.js"></script><script>
window.plausible=window.plausible||function(){(plausible.q=plausible.q||[]).push(arguments)},plausible.init=plausible.init||function(i){plausible.o=i||{}};
plausible.init()
</script>
</head>
<body data-spy="scroll" data-target="#toc">
<div class="container template-home">
<header><div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a class="navbar-link" href="index.html">feasts</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="articles/feasts.html">Introduction</a>
</li>
<li>
<a href="reference/index.html">Reference</a>
</li>
<li>
<a href="news/index.html">Changelog</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
News
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li class="dropdown-header">Release notes</li>
<li>
<a href="https://www.mitchelloharawild.com/blog/feasts/" class="external-link">Version 0.1.0</a>
</li>
<li>
<a href="news/index.html">Change log</a>
</li>
</ul>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/tidyverts/feasts" class="external-link">
<span class="fa fa-github fa-lg"></span>
</a>
</li>
</ul>
</div>
<!--/.nav-collapse -->
</div>
<!--/.container -->
</div>
<!--/.navbar -->
</header><div class="row">
<div class="contents col-md-9">
<div class="section level1">
<div class="page-header"><h1 id="feasts-">feasts <a href="https://feasts.tidyverts.org"><img src="reference/figures/logo.png" align="right" height="138.5"></a>
<a class="anchor" aria-label="anchor" href="#feasts-"></a>
</h1></div>
<!-- badges: start -->
<div class="section level2">
<h2 id="overview">Overview<a class="anchor" aria-label="anchor" href="#overview"></a>
</h2>
<p>feasts provides a collection of tools for the analysis of time series data. The package name is an acronym comprising of its key features: <em>Feature Extraction And Statistics for Time Series</em>.</p>
<p>The package works with tidy temporal data provided by the <a href="https://github.com/tidyverts/tsibble" class="external-link">tsibble</a> package to produce time series features, decompositions, statistical summaries and convenient visualisations. These features are useful in understanding the behaviour of time series data, and closely integrates with the tidy forecasting workflow used in the <a href="https://github.com/tidyverts/fable" class="external-link">fable</a> package.</p>
</div>
<div class="section level2">
<h2 id="installation">Installation<a class="anchor" aria-label="anchor" href="#installation"></a>
</h2>
<p>You could install the <strong>stable</strong> version from <a href="https://cran.r-project.org/package=feasts" class="external-link">CRAN</a>:</p>
<div class="sourceCode" id="cb1"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="fu"><a href="https://rdrr.io/r/utils/install.packages.html" class="external-link">install.packages</a></span><span class="op">(</span><span class="st">"feasts"</span><span class="op">)</span></span></code></pre></div>
<p>You can install the <strong>development</strong> version from <a href="https://github.com/tidyverts/feasts" class="external-link">GitHub</a> with:</p>
<div class="sourceCode" id="cb2"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="co"># install.packages("remotes")</span></span>
<span><span class="fu">remotes</span><span class="fu">::</span><span class="fu">install_github</span><span class="op">(</span><span class="st">"tidyverts/feasts"</span><span class="op">)</span></span></code></pre></div>
</div>
<div class="section level2">
<h2 id="usage">Usage<a class="anchor" aria-label="anchor" href="#usage"></a>
</h2>
<div class="sourceCode" id="cb3"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">library</a></span><span class="op">(</span><span class="va"><a href="http://feasts.tidyverts.org/" class="external-link">feasts</a></span><span class="op">)</span></span>
<span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">library</a></span><span class="op">(</span><span class="va"><a href="https://tsibble.tidyverts.org" class="external-link">tsibble</a></span><span class="op">)</span></span>
<span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">library</a></span><span class="op">(</span><span class="va"><a href="https://tsibbledata.tidyverts.org/" class="external-link">tsibbledata</a></span><span class="op">)</span></span>
<span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">library</a></span><span class="op">(</span><span class="va"><a href="https://dplyr.tidyverse.org" class="external-link">dplyr</a></span><span class="op">)</span></span>
<span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">library</a></span><span class="op">(</span><span class="va"><a href="https://ggplot2.tidyverse.org" class="external-link">ggplot2</a></span><span class="op">)</span></span>
<span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">library</a></span><span class="op">(</span><span class="va"><a href="https://lubridate.tidyverse.org" class="external-link">lubridate</a></span><span class="op">)</span></span></code></pre></div>
<div class="section level3">
<h3 id="graphics">Graphics<a class="anchor" aria-label="anchor" href="#graphics"></a>
</h3>
<p>Visualisation is often the first step in understanding the patterns in time series data. The package uses <a href="https://github.com/tidyverse/ggplot2" class="external-link">ggplot2</a> to produce customisable graphics to visualise time series patterns.</p>
<div class="sourceCode" id="cb4"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="va">aus_production</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%>%</a></span> <span class="fu"><a href="https://rdrr.io/pkg/ggtime/man/gg_season.html" class="external-link">gg_season</a></span><span class="op">(</span><span class="va">Beer</span><span class="op">)</span></span></code></pre></div>
<p><img src="reference/figures/README-graphics-1.png" alt="" width="100%"></p>
<div class="sourceCode" id="cb5"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="va">aus_production</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%>%</a></span> <span class="fu"><a href="https://rdrr.io/pkg/ggtime/man/gg_subseries.html" class="external-link">gg_subseries</a></span><span class="op">(</span><span class="va">Beer</span><span class="op">)</span></span></code></pre></div>
<p><img src="reference/figures/README-graphics-2.png" alt="" width="100%"></p>
<div class="sourceCode" id="cb6"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="va">aus_production</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%>%</a></span> <span class="fu"><a href="https://dplyr.tidyverse.org/reference/filter.html" class="external-link">filter</a></span><span class="op">(</span><span class="fu"><a href="https://lubridate.tidyverse.org/reference/year.html" class="external-link">year</a></span><span class="op">(</span><span class="va">Quarter</span><span class="op">)</span> <span class="op">></span> <span class="fl">1991</span><span class="op">)</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%>%</a></span> <span class="fu"><a href="https://rdrr.io/pkg/ggtime/man/gg_lag.html" class="external-link">gg_lag</a></span><span class="op">(</span><span class="va">Beer</span><span class="op">)</span></span></code></pre></div>
<p><img src="reference/figures/README-graphics-3.png" alt="" width="100%"></p>
<div class="sourceCode" id="cb7"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="va">aus_production</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%>%</a></span> <span class="fu"><a href="reference/ACF.html">ACF</a></span><span class="op">(</span><span class="va">Beer</span><span class="op">)</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%>%</a></span> <span class="fu"><a href="https://ggplot2.tidyverse.org/reference/autoplot.html" class="external-link">autoplot</a></span><span class="op">(</span><span class="op">)</span></span>
<span><span class="co">#> Plot variable not specified, automatically selected `.vars = acf`</span></span>
<span><span class="co">#> Don't know how to automatically pick scale for object of type <cf_lag/vctrs_vctr>. Defaulting to</span></span>
<span><span class="co">#> continuous.</span></span></code></pre></div>
<p><img src="reference/figures/README-graphics-4.png" alt="" width="100%"></p>
</div>
<div class="section level3">
<h3 id="decompositions">Decompositions<a class="anchor" aria-label="anchor" href="#decompositions"></a>
</h3>
<p>A common task in time series analysis is decomposing a time series into some simpler components. The feasts package supports two common time series decomposition methods:</p>
<ul>
<li>Classical decomposition</li>
<li>STL decomposition</li>
</ul>
<!--
* X11 decomposition
* X-13ARIMA-SEATS decomposition
--><div class="sourceCode" id="cb8"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="va">dcmp</span> <span class="op"><-</span> <span class="va">aus_production</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%>%</a></span></span>
<span> <span class="fu"><a href="https://fabletools.tidyverts.org/reference/model.html" class="external-link">model</a></span><span class="op">(</span><span class="fu"><a href="reference/STL.html">STL</a></span><span class="op">(</span><span class="va">Beer</span> <span class="op">~</span> <span class="fu">season</span><span class="op">(</span>window <span class="op">=</span> <span class="cn">Inf</span><span class="op">)</span><span class="op">)</span><span class="op">)</span></span>
<span><span class="fu"><a href="https://generics.r-lib.org/reference/components.html" class="external-link">components</a></span><span class="op">(</span><span class="va">dcmp</span><span class="op">)</span></span>
<span><span class="co">#> # A dable: 218 x 7 [1Q]</span></span>
<span><span class="co">#> # Key: .model [1]</span></span>
<span><span class="co">#> # : Beer = trend + season_year + remainder</span></span>
<span><span class="co">#> .model Quarter Beer trend season_year remainder season_adjust</span></span>
<span><span class="co">#> <chr> <qtr> <dbl> <dbl> <dbl> <dbl> <dbl></span></span>
<span><span class="co">#> 1 STL(Beer ~ season(window = Inf)) 1956 Q1 284 272. 2.14 10.1 282.</span></span>
<span><span class="co">#> 2 STL(Beer ~ season(window = Inf)) 1956 Q2 213 264. -42.6 -8.56 256.</span></span>
<span><span class="co">#> 3 STL(Beer ~ season(window = Inf)) 1956 Q3 227 258. -28.5 -2.34 255.</span></span>
<span><span class="co">#> 4 STL(Beer ~ season(window = Inf)) 1956 Q4 308 253. 69.0 -14.4 239.</span></span>
<span><span class="co">#> 5 STL(Beer ~ season(window = Inf)) 1957 Q1 262 257. 2.14 2.55 260.</span></span>
<span><span class="co">#> 6 STL(Beer ~ season(window = Inf)) 1957 Q2 228 261. -42.6 9.47 271.</span></span>
<span><span class="co">#> 7 STL(Beer ~ season(window = Inf)) 1957 Q3 236 263. -28.5 1.80 264.</span></span>
<span><span class="co">#> 8 STL(Beer ~ season(window = Inf)) 1957 Q4 320 264. 69.0 -12.7 251.</span></span>
<span><span class="co">#> 9 STL(Beer ~ season(window = Inf)) 1958 Q1 272 266. 2.14 4.32 270.</span></span>
<span><span class="co">#> 10 STL(Beer ~ season(window = Inf)) 1958 Q2 233 266. -42.6 9.72 276.</span></span>
<span><span class="co">#> # ℹ 208 more rows</span></span></code></pre></div>
<div class="sourceCode" id="cb9"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="fu"><a href="https://generics.r-lib.org/reference/components.html" class="external-link">components</a></span><span class="op">(</span><span class="va">dcmp</span><span class="op">)</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%>%</a></span> <span class="fu"><a href="https://ggplot2.tidyverse.org/reference/autoplot.html" class="external-link">autoplot</a></span><span class="op">(</span><span class="op">)</span></span>
<span><span class="co">#> Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.</span></span>
<span><span class="co">#> ℹ Please use `linewidth` instead.</span></span>
<span><span class="co">#> ℹ The deprecated feature was likely used in the ggtime package.</span></span>
<span><span class="co">#> Please report the issue to the authors.</span></span>
<span><span class="co">#> This warning is displayed once per session.</span></span>
<span><span class="co">#> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was generated.</span></span></code></pre></div>
<p><img src="reference/figures/README-dcmp-plot-1.png" alt="" width="100%"></p>
</div>
<div class="section level3">
<h3 id="feature-extraction-and-statistics">Feature extraction and statistics<a class="anchor" aria-label="anchor" href="#feature-extraction-and-statistics"></a>
</h3>
<p>Extract features and statistics across a large collection of time series to identify unusual/extreme time series, or find clusters of similar behaviour.</p>
<div class="sourceCode" id="cb10"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="va">aus_retail</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%>%</a></span></span>
<span> <span class="fu"><a href="https://fabletools.tidyverts.org/reference/features.html" class="external-link">features</a></span><span class="op">(</span><span class="va">Turnover</span>, <span class="va">feat_stl</span><span class="op">)</span></span>
<span><span class="co">#> # A tibble: 152 × 11</span></span>
<span><span class="co">#> State Industry trend_strength seasonal_strength_year seasonal_peak_year seasonal_trough_year</span></span>
<span><span class="co">#> <chr> <chr> <dbl> <dbl> <dbl> <dbl></span></span>
<span><span class="co">#> 1 Australia… Cafes, … 0.989 0.562 0 10</span></span>
<span><span class="co">#> 2 Australia… Cafes, … 0.993 0.629 0 10</span></span>
<span><span class="co">#> 3 Australia… Clothin… 0.991 0.923 9 11</span></span>
<span><span class="co">#> 4 Australia… Clothin… 0.993 0.957 9 11</span></span>
<span><span class="co">#> 5 Australia… Departm… 0.977 0.980 9 11</span></span>
<span><span class="co">#> 6 Australia… Electri… 0.992 0.933 9 11</span></span>
<span><span class="co">#> 7 Australia… Food re… 0.999 0.890 9 11</span></span>
<span><span class="co">#> 8 Australia… Footwea… 0.982 0.944 9 11</span></span>
<span><span class="co">#> 9 Australia… Furnitu… 0.981 0.687 9 1</span></span>
<span><span class="co">#> 10 Australia… Hardwar… 0.992 0.900 9 4</span></span>
<span><span class="co">#> # ℹ 142 more rows</span></span>
<span><span class="co">#> # ℹ 5 more variables: spikiness <dbl>, linearity <dbl>, curvature <dbl>, stl_e_acf1 <dbl>,</span></span>
<span><span class="co">#> # stl_e_acf10 <dbl></span></span></code></pre></div>
<p>This allows you to visualise the behaviour of many time series (where the plotting methods above would show too much information).</p>
<div class="sourceCode" id="cb11"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="va">aus_retail</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%>%</a></span></span>
<span> <span class="fu"><a href="https://fabletools.tidyverts.org/reference/features.html" class="external-link">features</a></span><span class="op">(</span><span class="va">Turnover</span>, <span class="va">feat_stl</span><span class="op">)</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%>%</a></span></span>
<span> <span class="fu"><a href="https://ggplot2.tidyverse.org/reference/ggplot.html" class="external-link">ggplot</a></span><span class="op">(</span><span class="fu"><a href="https://ggplot2.tidyverse.org/reference/aes.html" class="external-link">aes</a></span><span class="op">(</span>x <span class="op">=</span> <span class="va">trend_strength</span>, y <span class="op">=</span> <span class="va">seasonal_strength_year</span><span class="op">)</span><span class="op">)</span> <span class="op">+</span></span>
<span> <span class="fu"><a href="https://ggplot2.tidyverse.org/reference/geom_point.html" class="external-link">geom_point</a></span><span class="op">(</span><span class="op">)</span> <span class="op">+</span></span>
<span> <span class="fu"><a href="https://ggplot2.tidyverse.org/reference/facet_wrap.html" class="external-link">facet_wrap</a></span><span class="op">(</span><span class="fu"><a href="https://dplyr.tidyverse.org/reference/vars.html" class="external-link">vars</a></span><span class="op">(</span><span class="va">State</span><span class="op">)</span><span class="op">)</span></span></code></pre></div>
<p><img src="reference/figures/README-features-plot-1.png" alt="" width="100%"></p>
<p>Most of Australian’s retail industries are highly trended and seasonal for all states.</p>
<p>It’s also easy to extract the most (and least) seasonal time series.</p>
<div class="sourceCode" id="cb12"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="va">extreme_seasonalities</span> <span class="op"><-</span> <span class="va">aus_retail</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%>%</a></span></span>
<span> <span class="fu"><a href="https://fabletools.tidyverts.org/reference/features.html" class="external-link">features</a></span><span class="op">(</span><span class="va">Turnover</span>, <span class="va">feat_stl</span><span class="op">)</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%>%</a></span></span>
<span> <span class="fu"><a href="https://dplyr.tidyverse.org/reference/filter.html" class="external-link">filter</a></span><span class="op">(</span><span class="va">seasonal_strength_year</span> <span class="op"><a href="https://rdrr.io/r/base/match.html" class="external-link">%in%</a></span> <span class="fu"><a href="https://rdrr.io/r/base/range.html" class="external-link">range</a></span><span class="op">(</span><span class="va">seasonal_strength_year</span><span class="op">)</span><span class="op">)</span></span>
<span><span class="va">aus_retail</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%>%</a></span></span>
<span> <span class="fu"><a href="https://dplyr.tidyverse.org/reference/mutate-joins.html" class="external-link">right_join</a></span><span class="op">(</span><span class="va">extreme_seasonalities</span>, by <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"State"</span>, <span class="st">"Industry"</span><span class="op">)</span><span class="op">)</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%>%</a></span></span>
<span> <span class="fu"><a href="https://ggplot2.tidyverse.org/reference/ggplot.html" class="external-link">ggplot</a></span><span class="op">(</span><span class="fu"><a href="https://ggplot2.tidyverse.org/reference/aes.html" class="external-link">aes</a></span><span class="op">(</span>x <span class="op">=</span> <span class="va">Month</span>, y <span class="op">=</span> <span class="va">Turnover</span><span class="op">)</span><span class="op">)</span> <span class="op">+</span></span>
<span> <span class="fu"><a href="https://ggplot2.tidyverse.org/reference/geom_path.html" class="external-link">geom_line</a></span><span class="op">(</span><span class="op">)</span> <span class="op">+</span></span>
<span> <span class="fu"><a href="https://ggplot2.tidyverse.org/reference/facet_grid.html" class="external-link">facet_grid</a></span><span class="op">(</span><span class="fu"><a href="https://dplyr.tidyverse.org/reference/vars.html" class="external-link">vars</a></span><span class="op">(</span><span class="va">State</span>, <span class="va">Industry</span>, <span class="fu">scales</span><span class="fu">::</span><span class="fu"><a href="https://scales.r-lib.org/reference/percent_format.html" class="external-link">percent</a></span><span class="op">(</span><span class="va">seasonal_strength_year</span><span class="op">)</span><span class="op">)</span>,</span>
<span> scales <span class="op">=</span> <span class="st">"free_y"</span><span class="op">)</span></span></code></pre></div>
<p><img src="reference/figures/README-extreme-1.png" alt="" width="100%"></p>
</div>
</div>
</div>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
<div class="links">
<h2 data-toc-skip>Links</h2>
<ul class="list-unstyled">
<li><a href="https://cloud.r-project.org/package=feasts" class="external-link">View on CRAN</a></li>
<li><a href="https://github.com/tidyverts/feasts/" class="external-link">Browse source code</a></li>
<li><a href="https://github.com/tidyverts/feasts/issues" class="external-link">Report a bug</a></li>
</ul>
</div>
<div class="license">
<h2 data-toc-skip>License</h2>
<ul class="list-unstyled">
<li><a href="https://www.r-project.org/Licenses/GPL-3" class="external-link">GPL-3</a></li>
</ul>
</div>
<div class="citation">
<h2 data-toc-skip>Citation</h2>
<ul class="list-unstyled">
<li><a href="authors.html#citation">Citing feasts</a></li>
</ul>
</div>
<div class="developers">
<h2 data-toc-skip>Developers</h2>
<ul class="list-unstyled">
<li>
<a href="https://mitchelloharawild.com" class="external-link">Mitchell O'Hara-Wild</a> <br><small class="roles"> Author, maintainer </small> </li>
<li>
<a href="http://robjhyndman.com" class="external-link">Rob Hyndman</a> <br><small class="roles"> Author </small> </li>
<li>
<a href="https://earo.me" class="external-link">Earo Wang</a> <br><small class="roles"> Author </small> </li>
<li><a href="authors.html">More about authors...</a></li>
</ul>
</div>
</div>
</div>
<footer><div class="copyright">
<p></p>
<p>Developed by <a href="https://mitchelloharawild.com" class="external-link">Mitchell O’Hara-Wild</a>, <a href="http://robjhyndman.com" class="external-link">Rob Hyndman</a>, <a href="https://earo.me" class="external-link">Earo Wang</a>.</p>
</div>
<div class="pkgdown">
<p></p>
<p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 2.2.0.</p>
</div>
</footer>
</div>
</body>
</html>