-
Notifications
You must be signed in to change notification settings - Fork 3
/
getting-started.html
191 lines (161 loc) · 31 KB
/
getting-started.html
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
<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html lang="en">
<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, shrink-to-fit=no">
<meta name="description" content="healthyR">
<title>Getting Started with healthyR • healthyR</title>
<script src="../deps/jquery-3.6.0/jquery-3.6.0.min.js"></script><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link href="../deps/bootstrap-5.2.2/bootstrap.min.css" rel="stylesheet">
<script src="../deps/bootstrap-5.2.2/bootstrap.bundle.min.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">
<!-- bootstrap-toc --><script src="https://cdn.jsdelivr.net/gh/afeld/[email protected]/dist/bootstrap-toc.min.js" integrity="sha256-4veVQbu7//Lk5TSmc7YV48MxtMy98e26cf5MrgZYnwo=" 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><!-- 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><!-- search --><script src="https://cdnjs.cloudflare.com/ajax/libs/fuse.js/6.4.6/fuse.js" integrity="sha512-zv6Ywkjyktsohkbp9bb45V6tEMoWhzFzXis+LrMehmJZZSys19Yxf1dopHx7WzIKxr5tK2dVcYmaCk2uqdjF4A==" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/autocomplete.js/0.38.0/autocomplete.jquery.min.js" integrity="sha512-GU9ayf+66Xx2TmpxqJpliWbT5PiGYxpaG8rfnBEk1LL8l1KGkRShhngwdXK1UgqhAzWpZHSiYPc09/NwDQIGyg==" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.11.1/mark.min.js" integrity="sha512-5CYOlHXGh6QpOFA/TeTylKLWfB3ftPsde7AnmhuitiTX4K5SqCLBeKro6sPS8ilsz1Q4NRx3v8Ko2IBiszzdww==" crossorigin="anonymous"></script><!-- pkgdown --><script src="../pkgdown.js"></script><meta property="og:title" content="Getting Started with healthyR">
<meta property="og:description" content="healthyR">
<!-- 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]-->
</head>
<body>
<a href="#main" class="visually-hidden-focusable">Skip to contents</a>
<nav class="navbar fixed-top navbar-dark navbar-expand-lg bg-primary"><div class="container">
<a class="navbar-brand me-2" href="../index.html">healthyR</a>
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.1.9000</small>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div id="navbar" class="collapse navbar-collapse ms-3">
<ul class="navbar-nav me-auto">
<li class="nav-item">
<a class="nav-link" href="../index.html">
<span class="fa fa-home"></span>
</a>
</li>
<li class="active nav-item">
<a class="nav-link" href="../articles/getting-started.html">Getting Started</a>
</li>
<li class="nav-item">
<a class="nav-link" href="../articles/index.html">Articles</a>
</li>
<li class="nav-item">
<a class="nav-link" href="../reference/index.html">Function Reference</a>
</li>
<li class="nav-item">
<a class="nav-link" href="../news/index.html">News</a>
</li>
</ul>
<form class="form-inline my-2 my-lg-0" role="search">
<input type="search" class="form-control me-sm-2" aria-label="Toggle navigation" name="search-input" data-search-index="../search.json" id="search-input" placeholder="Search for" autocomplete="off">
</form>
<ul class="navbar-nav">
<li class="nav-item">
<a class="external-link nav-link" href="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/spsanderson/healthyR/" aria-label="github">
<span class="fab fa fab fa-github fa-lg"></span>
</a>
</li>
</ul>
</div>
</div>
</nav><div class="container template-article">
<script src="getting-started_files/htmlwidgets-1.6.2/htmlwidgets.js"></script><script src="getting-started_files/plotly-binding-4.10.1/plotly.js"></script><script src="getting-started_files/typedarray-0.1/typedarray.min.js"></script><link href="getting-started_files/crosstalk-1.2.0/css/crosstalk.min.css" rel="stylesheet">
<script src="getting-started_files/crosstalk-1.2.0/js/crosstalk.min.js"></script><link href="getting-started_files/plotly-htmlwidgets-css-2.11.1/plotly-htmlwidgets.css" rel="stylesheet">
<script src="getting-started_files/plotly-main-2.11.1/plotly-latest.min.js"></script><div class="row">
<main id="main" class="col-md-9"><div class="page-header">
<img src="" class="logo" alt=""><h1>Getting Started with healthyR</h1>
<h3 data-toc-skip class="subtitle">A Quick Introduction</h3>
<h4 data-toc-skip class="author">Steven P.
Sanderson II, MPH</h4>
<h4 data-toc-skip class="date">2023-05-02</h4>
<small class="dont-index">Source: <a href="https://github.com/spsanderson/healthyR/blob/HEAD/vignettes/getting-started.Rmd" class="external-link"><code>vignettes/getting-started.Rmd</code></a></small>
<div class="d-none name"><code>getting-started.Rmd</code></div>
</div>
<blockquote>
<p>healthyR: A toolkit for hospital data</p>
</blockquote>
<div class="section level2">
<h2 id="libaray-load">Libaray Load<a class="anchor" aria-label="anchor" href="#libaray-load"></a>
</h2>
<p>First things first, lets load in the library:</p>
<div class="sourceCode" id="cb1"><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="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/spsanderson/healthyR" class="external-link">healthyR</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="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/spsanderson/healthyR.data" class="external-link">healthyR.data</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="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/business-science/timetk" class="external-link">timetk</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://purrr.tidyverse.org/" class="external-link">purrr</a></span><span class="op">)</span></span></code></pre></div>
</div>
<div class="section level2">
<h2 id="generate-sample-data">Generate Sample Data<a class="anchor" aria-label="anchor" href="#generate-sample-data"></a>
</h2>
<p>First we are going to take a look at some time series plotting
functions. These are fairly straight forward and therefore should seem
intuitive. We are going to generate some random numbers to simulate
different daily average length of stay data. We will set a seed for
reproducibility.</p>
<div class="sourceCode" id="cb2"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="co"># Get Length of Stay Data</span></span>
<span><span class="va">data_tbl</span> <span class="op"><-</span> <span class="va">healthyR_data</span></span>
<span></span>
<span><span class="va">df_tbl</span> <span class="op"><-</span> <span class="va">data_tbl</span> <span class="op"><a href="../reference/pipe.html">%>%</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">ip_op_flag</span> <span class="op">==</span> <span class="st">"I"</span><span class="op">)</span> <span class="op"><a href="../reference/pipe.html">%>%</a></span></span>
<span> <span class="fu"><a href="https://dplyr.tidyverse.org/reference/select.html" class="external-link">select</a></span><span class="op">(</span><span class="va">visit_end_date_time</span>, <span class="va">length_of_stay</span><span class="op">)</span> <span class="op"><a href="../reference/pipe.html">%>%</a></span></span>
<span> <span class="fu"><a href="https://rdrr.io/pkg/timetk/man/summarise_by_time.html" class="external-link">summarise_by_time</a></span><span class="op">(</span></span>
<span> .date_var <span class="op">=</span> <span class="va">visit_end_date_time</span></span>
<span> , .by <span class="op">=</span> <span class="st">"day"</span></span>
<span> , visits <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/mean.html" class="external-link">mean</a></span><span class="op">(</span><span class="va">length_of_stay</span>, na.rm <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span>
<span> <span class="op">)</span> <span class="op"><a href="../reference/pipe.html">%>%</a></span></span>
<span> <span class="fu"><a href="https://rdrr.io/pkg/timetk/man/filter_by_time.html" class="external-link">filter_by_time</a></span><span class="op">(</span></span>
<span> .date_var <span class="op">=</span> <span class="va">visit_end_date_time</span></span>
<span> , .start_date <span class="op">=</span> <span class="st">"2012"</span></span>
<span> , .end_date <span class="op">=</span> <span class="st">"2019"</span></span>
<span> <span class="op">)</span> <span class="op"><a href="../reference/pipe.html">%>%</a></span></span>
<span> <span class="fu"><a href="https://rlang.r-lib.org/reference/set_names.html" class="external-link">set_names</a></span><span class="op">(</span><span class="st">"Date"</span>,<span class="st">"Values"</span><span class="op">)</span></span></code></pre></div>
</div>
<div class="section level2">
<h2 id="plot-the-time-series">Plot the Time Series<a class="anchor" aria-label="anchor" href="#plot-the-time-series"></a>
</h2>
<p>Now that we have our data lets see how easy it is to generate an ALOS
chart:</p>
<div class="sourceCode" id="cb3"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="fu"><a href="../reference/ts_alos_plt.html">ts_alos_plt</a></span><span class="op">(</span></span>
<span> .data <span class="op">=</span> <span class="va">df_tbl</span></span>
<span> , .date_col <span class="op">=</span> <span class="va">Date</span></span>
<span> , .value_col <span class="op">=</span> <span class="va">Values</span></span>
<span> , .by <span class="op">=</span> <span class="st">"month"</span></span>
<span> , .interactive <span class="op">=</span> <span class="cn">FALSE</span></span>
<span><span class="op">)</span></span></code></pre></div>
<p><img src="getting-started_files/figure-html/alos_plot-1.png" width="95%" style="display: block; margin: auto;"></p>
<p>And with the <code>.interactive</code> option set to
<strong>TRUE</strong>:</p>
<div class="sourceCode" id="cb4"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="fu"><a href="../reference/ts_alos_plt.html">ts_alos_plt</a></span><span class="op">(</span></span>
<span> .data <span class="op">=</span> <span class="va">df_tbl</span></span>
<span> , .date_col <span class="op">=</span> <span class="va">Date</span></span>
<span> , .value_col <span class="op">=</span> <span class="va">Values</span></span>
<span> , .by <span class="op">=</span> <span class="st">"month"</span></span>
<span> , .interactive <span class="op">=</span> <span class="cn">TRUE</span></span>
<span><span class="op">)</span></span></code></pre></div>
<div class="plotly html-widget html-fill-item-overflow-hidden html-fill-item" id="htmlwidget-45e04751979bdef87eec" style="width:95%;height:450px;"></div>
<script type="application/json" data-for="htmlwidget-45e04751979bdef87eec">{"x":{"data":[{"x":[1325376000,1328054400,1330560000,1333238400,1335830400,1338508800,1341100800,1343779200,1346457600,1349049600,1351728000,1354320000,1356998400,1359676800,1362096000,1364774400,1367366400,1370044800,1372636800,1375315200,1377993600,1380585600,1383264000,1385856000,1388534400,1391212800,1393632000,1396310400,1398902400,1401580800,1404172800,1406851200,1409529600,1412121600,1414800000,1417392000,1420070400,1422748800,1425168000,1427846400,1430438400,1433116800,1435708800,1438387200,1441065600,1443657600,1446336000,1448928000,1451606400,1454284800,1456790400,1459468800,1462060800,1464739200,1467331200,1470009600,1472688000,1475280000,1477958400,1480550400,1483228800,1485907200,1488326400,1491004800,1493596800,1496275200,1498867200,1501545600,1504224000,1506816000,1509494400,1512086400,1514764800,1517443200,1519862400,1522540800,1525132800,1527811200,1530403200,1533081600,1535760000,1538352000,1541030400,1543622400,1546300800,1548979200,1551398400,1554076800,1556668800,1559347200,1561939200,1564617600,1567296000,1569888000,1572566400,1575158400],"y":[5.59106327369531,5.86793348683907,5.30110052280995,4.9184421327549,5.16048974574955,4.78380684297118,5.2005391859233,5.04984929865685,5.26955803247125,5.58593723152517,5.64887330741782,5.51618921426678,6.00373465924507,6.07606661611877,6.05195098335531,5.78556441305175,5.64358725772815,5.73721340565536,5.82883957521205,5.57003465318156,5.80945961950656,5.98025465217726,5.93921495172256,6.54167008912734,6.28405841799455,5.85851656201937,6.19288480386156,5.81811649380557,5.53874887447105,5.65826500648382,5.75775297767597,5.92694020313438,5.84626167630156,6.0848106525647,5.6827938382805,6.21336882153156,6.38523035601847,7.29655256016696,6.10919958073599,5.98358421281018,5.63479336013546,5.87082792757324,5.84940184944429,6.0123943345111,5.93426195397999,6.12190990826183,5.92634399817973,5.91524094465842,6.26957787260714,6.3413289356115,6.5525046198482,5.78622494088708,6.62134985035222,6.08526014257038,6.20155261220888,6.63173551031323,6.00950432920936,6.32339380184733,6.372836485438,6.55519817196857,6.93655065796734,6.06081589086898,6.54851809136582,5.56018685438023,5.83429145214047,6.07786913206239,5.61753338227996,5.74988689898073,5.83155088777353,6.61265214838348,5.72284446450687,5.40338155110872,6.29428130725608,6.81778714876095,6.16135641074441,6.29658745674623,5.95283527239998,5.62360921277225,5.31498086975131,6.04943445599637,5.52136892161851,5.99953879896391,5.98068470334273,5.69790835050605,6.14951023545008,6.01802931729223,6.44648902012465,6.25997056673386,5.80712213037785,5.55540169406675,5.69273983594891,5.67769650181202,5.89843800003021,6.1023328427012,5.88961082057142,6.54405353108245],"text":["date: 2012-01-01<br />.value: 5.591063","date: 2012-02-01<br />.value: 5.867933","date: 2012-03-01<br />.value: 5.301101","date: 2012-04-01<br />.value: 4.918442","date: 2012-05-01<br />.value: 5.160490","date: 2012-06-01<br />.value: 4.783807","date: 2012-07-01<br />.value: 5.200539","date: 2012-08-01<br />.value: 5.049849","date: 2012-09-01<br />.value: 5.269558","date: 2012-10-01<br />.value: 5.585937","date: 2012-11-01<br />.value: 5.648873","date: 2012-12-01<br />.value: 5.516189","date: 2013-01-01<br />.value: 6.003735","date: 2013-02-01<br />.value: 6.076067","date: 2013-03-01<br />.value: 6.051951","date: 2013-04-01<br />.value: 5.785564","date: 2013-05-01<br />.value: 5.643587","date: 2013-06-01<br />.value: 5.737213","date: 2013-07-01<br />.value: 5.828840","date: 2013-08-01<br />.value: 5.570035","date: 2013-09-01<br />.value: 5.809460","date: 2013-10-01<br />.value: 5.980255","date: 2013-11-01<br />.value: 5.939215","date: 2013-12-01<br />.value: 6.541670","date: 2014-01-01<br />.value: 6.284058","date: 2014-02-01<br />.value: 5.858517","date: 2014-03-01<br />.value: 6.192885","date: 2014-04-01<br />.value: 5.818116","date: 2014-05-01<br />.value: 5.538749","date: 2014-06-01<br />.value: 5.658265","date: 2014-07-01<br />.value: 5.757753","date: 2014-08-01<br />.value: 5.926940","date: 2014-09-01<br />.value: 5.846262","date: 2014-10-01<br />.value: 6.084811","date: 2014-11-01<br />.value: 5.682794","date: 2014-12-01<br />.value: 6.213369","date: 2015-01-01<br />.value: 6.385230","date: 2015-02-01<br />.value: 7.296553","date: 2015-03-01<br />.value: 6.109200","date: 2015-04-01<br />.value: 5.983584","date: 2015-05-01<br />.value: 5.634793","date: 2015-06-01<br />.value: 5.870828","date: 2015-07-01<br />.value: 5.849402","date: 2015-08-01<br />.value: 6.012394","date: 2015-09-01<br />.value: 5.934262","date: 2015-10-01<br />.value: 6.121910","date: 2015-11-01<br />.value: 5.926344","date: 2015-12-01<br />.value: 5.915241","date: 2016-01-01<br />.value: 6.269578","date: 2016-02-01<br />.value: 6.341329","date: 2016-03-01<br />.value: 6.552505","date: 2016-04-01<br />.value: 5.786225","date: 2016-05-01<br />.value: 6.621350","date: 2016-06-01<br />.value: 6.085260","date: 2016-07-01<br />.value: 6.201553","date: 2016-08-01<br />.value: 6.631736","date: 2016-09-01<br />.value: 6.009504","date: 2016-10-01<br />.value: 6.323394","date: 2016-11-01<br />.value: 6.372836","date: 2016-12-01<br />.value: 6.555198","date: 2017-01-01<br />.value: 6.936551","date: 2017-02-01<br />.value: 6.060816","date: 2017-03-01<br />.value: 6.548518","date: 2017-04-01<br />.value: 5.560187","date: 2017-05-01<br />.value: 5.834291","date: 2017-06-01<br />.value: 6.077869","date: 2017-07-01<br />.value: 5.617533","date: 2017-08-01<br />.value: 5.749887","date: 2017-09-01<br />.value: 5.831551","date: 2017-10-01<br />.value: 6.612652","date: 2017-11-01<br />.value: 5.722844","date: 2017-12-01<br />.value: 5.403382","date: 2018-01-01<br />.value: 6.294281","date: 2018-02-01<br />.value: 6.817787","date: 2018-03-01<br />.value: 6.161356","date: 2018-04-01<br />.value: 6.296587","date: 2018-05-01<br />.value: 5.952835","date: 2018-06-01<br />.value: 5.623609","date: 2018-07-01<br />.value: 5.314981","date: 2018-08-01<br />.value: 6.049434","date: 2018-09-01<br />.value: 5.521369","date: 2018-10-01<br />.value: 5.999539","date: 2018-11-01<br />.value: 5.980685","date: 2018-12-01<br />.value: 5.697908","date: 2019-01-01<br />.value: 6.149510","date: 2019-02-01<br />.value: 6.018029","date: 2019-03-01<br />.value: 6.446489","date: 2019-04-01<br />.value: 6.259971","date: 2019-05-01<br />.value: 5.807122","date: 2019-06-01<br />.value: 5.555402","date: 2019-07-01<br />.value: 5.692740","date: 2019-08-01<br />.value: 5.677697","date: 2019-09-01<br />.value: 5.898438","date: 2019-10-01<br />.value: 6.102333","date: 2019-11-01<br />.value: 5.889611","date: 2019-12-01<br />.value: 6.544054"],"type":"scatter","mode":"lines","line":{"width":1.88976377952756,"color":"rgba(44,62,80,1)","dash":"solid"},"hoveron":"points","showlegend":false,"xaxis":"x","yaxis":"y","hoverinfo":"text","frame":null},{"x":[1325376000,1328054400,1330560000,1333238400,1335830400,1338508800,1341100800,1343779200,1346457600,1349049600,1351728000,1354320000,1356998400,1359676800,1362096000,1364774400,1367366400,1370044800,1372636800,1375315200,1377993600,1380585600,1383264000,1385856000,1388534400,1391212800,1393632000,1396310400,1398902400,1401580800,1404172800,1406851200,1409529600,1412121600,1414800000,1417392000,1420070400,1422748800,1425168000,1427846400,1430438400,1433116800,1435708800,1438387200,1441065600,1443657600,1446336000,1448928000,1451606400,1454284800,1456790400,1459468800,1462060800,1464739200,1467331200,1470009600,1472688000,1475280000,1477958400,1480550400,1483228800,1485907200,1488326400,1491004800,1493596800,1496275200,1498867200,1501545600,1504224000,1506816000,1509494400,1512086400,1514764800,1517443200,1519862400,1522540800,1525132800,1527811200,1530403200,1533081600,1535760000,1538352000,1541030400,1543622400,1546300800,1548979200,1551398400,1554076800,1556668800,1559347200,1561939200,1564617600,1567296000,1569888000,1572566400,1575158400],"y":[5.22699345069203,5.26409530492423,5.30047509229101,5.33611592717479,5.37100092395793,5.40511319702285,5.43843586075191,5.47095202952752,5.50264481773206,5.53349733974792,5.56349270995748,5.59261404274316,5.6208492296262,5.64821928339797,5.67475700034599,5.70049517675779,5.72546660892089,5.74970409312281,5.77324042565107,5.79610840279319,5.81834082083671,5.83997047606913,5.86103016477799,5.8815526832508,5.9009447853154,5.9187113239616,5.93503224421989,5.95008749112079,5.9640570096948,5.97712074497242,5.98945864198416,6.00125064576051,6.01267670133197,6.02391675372907,6.03515074798228,6.04655862912213,6.0584510260011,6.07086950314488,6.08359040909379,6.09639009238814,6.10904490156824,6.1213311851744,6.13302529174694,6.14390356982617,6.1537423679524,6.16231803466594,6.1694069185071,6.1747853680162,6.17888449204493,6.18228194778459,6.18497390628484,6.18695653859538,6.18822601576588,6.18877850884602,6.18861018888548,6.18771722693395,6.18609579404111,6.18374206125664,6.18065219963021,6.17682238021151,6.17154322004232,6.16433962062527,6.15555917970137,6.14554949501161,6.134658164297,6.12323278529854,6.11162095575721,6.10017027341403,6.08922833600998,6.07914274128608,6.07026108698331,6.06293097084267,6.05627270119452,6.04923187871226,6.04189403965149,6.03434472026782,6.02666945681683,6.01895378555415,6.01128324273535,6.00374336461604,5.99641968745183,5.9893977474983,5.98276308101107,5.97660122424573,5.97088788510894,5.96552269736359,5.96047708604953,5.95572247620667,5.95123029287488,5.94697196109404,5.94291890590406,5.9390425523448,5.93531432545615,5.93170565027799,5.92818795185022,5.92473265521271],"text":["date: 2012-01-01<br />.value_smooth: 5.226993","date: 2012-02-01<br />.value_smooth: 5.264095","date: 2012-03-01<br />.value_smooth: 5.300475","date: 2012-04-01<br />.value_smooth: 5.336116","date: 2012-05-01<br />.value_smooth: 5.371001","date: 2012-06-01<br />.value_smooth: 5.405113","date: 2012-07-01<br />.value_smooth: 5.438436","date: 2012-08-01<br />.value_smooth: 5.470952","date: 2012-09-01<br />.value_smooth: 5.502645","date: 2012-10-01<br />.value_smooth: 5.533497","date: 2012-11-01<br />.value_smooth: 5.563493","date: 2012-12-01<br />.value_smooth: 5.592614","date: 2013-01-01<br />.value_smooth: 5.620849","date: 2013-02-01<br />.value_smooth: 5.648219","date: 2013-03-01<br />.value_smooth: 5.674757","date: 2013-04-01<br />.value_smooth: 5.700495","date: 2013-05-01<br />.value_smooth: 5.725467","date: 2013-06-01<br />.value_smooth: 5.749704","date: 2013-07-01<br />.value_smooth: 5.773240","date: 2013-08-01<br />.value_smooth: 5.796108","date: 2013-09-01<br />.value_smooth: 5.818341","date: 2013-10-01<br />.value_smooth: 5.839970","date: 2013-11-01<br />.value_smooth: 5.861030","date: 2013-12-01<br />.value_smooth: 5.881553","date: 2014-01-01<br />.value_smooth: 5.900945","date: 2014-02-01<br />.value_smooth: 5.918711","date: 2014-03-01<br />.value_smooth: 5.935032","date: 2014-04-01<br />.value_smooth: 5.950087","date: 2014-05-01<br />.value_smooth: 5.964057","date: 2014-06-01<br />.value_smooth: 5.977121","date: 2014-07-01<br />.value_smooth: 5.989459","date: 2014-08-01<br />.value_smooth: 6.001251","date: 2014-09-01<br />.value_smooth: 6.012677","date: 2014-10-01<br />.value_smooth: 6.023917","date: 2014-11-01<br />.value_smooth: 6.035151","date: 2014-12-01<br />.value_smooth: 6.046559","date: 2015-01-01<br />.value_smooth: 6.058451","date: 2015-02-01<br />.value_smooth: 6.070870","date: 2015-03-01<br />.value_smooth: 6.083590","date: 2015-04-01<br />.value_smooth: 6.096390","date: 2015-05-01<br />.value_smooth: 6.109045","date: 2015-06-01<br />.value_smooth: 6.121331","date: 2015-07-01<br />.value_smooth: 6.133025","date: 2015-08-01<br />.value_smooth: 6.143904","date: 2015-09-01<br />.value_smooth: 6.153742","date: 2015-10-01<br />.value_smooth: 6.162318","date: 2015-11-01<br />.value_smooth: 6.169407","date: 2015-12-01<br />.value_smooth: 6.174785","date: 2016-01-01<br />.value_smooth: 6.178884","date: 2016-02-01<br />.value_smooth: 6.182282","date: 2016-03-01<br />.value_smooth: 6.184974","date: 2016-04-01<br />.value_smooth: 6.186957","date: 2016-05-01<br />.value_smooth: 6.188226","date: 2016-06-01<br />.value_smooth: 6.188779","date: 2016-07-01<br />.value_smooth: 6.188610","date: 2016-08-01<br />.value_smooth: 6.187717","date: 2016-09-01<br />.value_smooth: 6.186096","date: 2016-10-01<br />.value_smooth: 6.183742","date: 2016-11-01<br />.value_smooth: 6.180652","date: 2016-12-01<br />.value_smooth: 6.176822","date: 2017-01-01<br />.value_smooth: 6.171543","date: 2017-02-01<br />.value_smooth: 6.164340","date: 2017-03-01<br />.value_smooth: 6.155559","date: 2017-04-01<br />.value_smooth: 6.145549","date: 2017-05-01<br />.value_smooth: 6.134658","date: 2017-06-01<br />.value_smooth: 6.123233","date: 2017-07-01<br />.value_smooth: 6.111621","date: 2017-08-01<br />.value_smooth: 6.100170","date: 2017-09-01<br />.value_smooth: 6.089228","date: 2017-10-01<br />.value_smooth: 6.079143","date: 2017-11-01<br />.value_smooth: 6.070261","date: 2017-12-01<br />.value_smooth: 6.062931","date: 2018-01-01<br />.value_smooth: 6.056273","date: 2018-02-01<br />.value_smooth: 6.049232","date: 2018-03-01<br />.value_smooth: 6.041894","date: 2018-04-01<br />.value_smooth: 6.034345","date: 2018-05-01<br />.value_smooth: 6.026669","date: 2018-06-01<br />.value_smooth: 6.018954","date: 2018-07-01<br />.value_smooth: 6.011283","date: 2018-08-01<br />.value_smooth: 6.003743","date: 2018-09-01<br />.value_smooth: 5.996420","date: 2018-10-01<br />.value_smooth: 5.989398","date: 2018-11-01<br />.value_smooth: 5.982763","date: 2018-12-01<br />.value_smooth: 5.976601","date: 2019-01-01<br />.value_smooth: 5.970888","date: 2019-02-01<br />.value_smooth: 5.965523","date: 2019-03-01<br />.value_smooth: 5.960477","date: 2019-04-01<br />.value_smooth: 5.955722","date: 2019-05-01<br />.value_smooth: 5.951230","date: 2019-06-01<br />.value_smooth: 5.946972","date: 2019-07-01<br />.value_smooth: 5.942919","date: 2019-08-01<br />.value_smooth: 5.939043","date: 2019-09-01<br />.value_smooth: 5.935314","date: 2019-10-01<br />.value_smooth: 5.931706","date: 2019-11-01<br />.value_smooth: 5.928188","date: 2019-12-01<br />.value_smooth: 5.924733"],"type":"scatter","mode":"lines","line":{"width":3.77952755905512,"color":"rgba(51,102,255,1)","dash":"solid"},"hoveron":"points","showlegend":false,"xaxis":"x","yaxis":"y","hoverinfo":"text","frame":null}],"layout":{"margin":{"t":46.5225773718924,"r":7.30593607305936,"b":28.3307965499746,"l":28.4931506849315},"font":{"color":"rgba(0,0,0,1)","family":"","size":14.6118721461187},"title":{"text":"Average Length of Stay Plot","font":{"color":"rgba(0,0,0,1)","family":"","size":17.5342465753425},"x":0,"xref":"paper"},"xaxis":{"domain":[0,1],"automargin":true,"type":"linear","autorange":false,"range":[1312886880,1587647520],"tickmode":"array","ticktext":["2012","2014","2016","2018","2020"],"tickvals":[1325376000,1388534400,1451606400,1514764800,1577836800],"categoryorder":"array","categoryarray":["2012","2014","2016","2018","2020"],"nticks":null,"ticks":"","tickcolor":null,"ticklen":3.65296803652968,"tickwidth":0,"showticklabels":true,"tickfont":{"color":"rgba(77,77,77,1)","family":"","size":11.689497716895},"tickangle":-0,"showline":false,"linecolor":null,"linewidth":0,"showgrid":true,"gridcolor":"rgba(235,235,235,1)","gridwidth":0.66417600664176,"zeroline":false,"anchor":"y","title":{"text":"","font":{"color":"rgba(0,0,0,1)","family":"","size":14.6118721461187}},"hoverformat":".2f"},"yaxis":{"domain":[0,1],"automargin":true,"type":"linear","autorange":false,"range":[4.65816955711139,7.42218984602675],"tickmode":"array","ticktext":["5.0","5.5","6.0","6.5","7.0"],"tickvals":[5,5.5,6,6.5,7],"categoryorder":"array","categoryarray":["5.0","5.5","6.0","6.5","7.0"],"nticks":null,"ticks":"","tickcolor":null,"ticklen":3.65296803652968,"tickwidth":0,"showticklabels":true,"tickfont":{"color":"rgba(77,77,77,1)","family":"","size":11.689497716895},"tickangle":-0,"showline":false,"linecolor":null,"linewidth":0,"showgrid":true,"gridcolor":"rgba(235,235,235,1)","gridwidth":0.66417600664176,"zeroline":false,"anchor":"x","title":{"text":"","font":{"color":"rgba(0,0,0,1)","family":"","size":14.6118721461187}},"hoverformat":".2f"},"shapes":[{"type":"rect","fillcolor":null,"line":{"color":null,"width":0,"linetype":[]},"yref":"paper","xref":"paper","x0":0,"x1":1,"y0":0,"y1":1}],"showlegend":false,"legend":{"bgcolor":null,"bordercolor":null,"borderwidth":0,"font":{"color":"rgba(0,0,0,1)","family":"","size":11.689497716895}},"hovermode":"closest","barmode":"relative"},"config":{"doubleClick":"reset","modeBarButtonsToAdd":["hoverclosest","hovercompare"],"showSendToCloud":false},"source":"A","attrs":{"3a0c4a4e3ccc":{"x":{},"y":{},"type":"scatter"},"3a0c3ef74466":{"x":{},"y":{}}},"cur_data":"3a0c4a4e3ccc","visdat":{"3a0c4a4e3ccc":["function (y) ","x"],"3a0c3ef74466":["function (y) ","x"]},"highlight":{"on":"plotly_click","persistent":false,"dynamic":false,"selectize":false,"opacityDim":0.2,"selected":{"opacity":1},"debounce":0},"shinyEvents":["plotly_hover","plotly_click","plotly_selected","plotly_relayout","plotly_brushed","plotly_brushing","plotly_clickannotation","plotly_doubleclick","plotly_deselect","plotly_afterplot","plotly_sunburstclick"],"base_url":"https://plot.ly"},"evals":[],"jsHooks":[]}</script><p>As we can see, this function has the ability to return either a
static plot or and interactive plot. Under the hood it is using the
<code><a href="https://rdrr.io/pkg/timetk/man/plot_time_series.html" class="external-link">timetk::plot_time_series</a></code> function. You can find out more on
the the timetk function <a href="https://business-science.github.io/timetk/reference/plot_time_series.html" class="external-link">here.</a></p>
<p>That is the end of this first and very quick tutorial on the
<code>ts_alos_plt</code> function.</p>
</div>
</main><aside class="col-md-3"><nav id="toc"><h2>On this page</h2>
</nav></aside>
</div>
<footer><div class="pkgdown-footer-left">
<p></p>
<p>Developed by Steven Sanderson.</p>
</div>
<div class="pkgdown-footer-right">
<p></p>
<p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 2.0.7.</p>
</div>
</footer>
</div>
</body>
</html>