-
Notifications
You must be signed in to change notification settings - Fork 6
/
index.html
230 lines (212 loc) · 15.5 KB
/
index.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
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
<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html>
<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>Get WHO Tuberculosis Data • Get WHO Tuberculosis Data in R</title>
<!-- jquery --><script src="https://code.jquery.com/jquery-3.1.0.min.js" integrity="sha384-nrOSfDHtoPMzJHjVTdCopGqIqeYETSXhZDFyniQ8ZHcVy08QesyHcnOUpMpqnmWq" crossorigin="anonymous"></script><!-- Bootstrap --><link href="https://maxcdn.bootstrapcdn.com/bootswatch/3.3.7/flatly/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script><!-- Font Awesome icons --><link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous">
<!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/1.7.1/clipboard.min.js" integrity="sha384-cV+rhyOuRHc9Ub/91rihWcGmMmCXDeksTtCihMupQHSsi8GIIRDG0ThDc3HGQFJ3" crossorigin="anonymous"></script><!-- pkgdown --><link href="pkgdown.css" rel="stylesheet">
<script src="jquery.sticky-kit.min.js"></script><script src="pkgdown.js"></script><meta property="og:title" content="Get WHO Tuberculosis Data">
<meta property="og:description" content="Facilitates easy import of analysis ready World Health Organisation Tuberculosis data and provides plotting functions for exploratory data analysis.">
<meta name="twitter:card" content="summary">
<!-- mathjax --><script src="https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></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>
<div class="container template-vignette">
<header><div class="navbar navbar-inverse 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">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">getTBinR</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="index.html">Home</a>
</li>
<li>
<a href="articles/intro.html">Getting Started</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
Case Studies
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="articles/case_study_global_trends.html">Exploring Global Trends in Tuberculosis Incidence Rates</a>
</li>
<li>
<a href="articles/case_fatality_rate.html">Exploring Estimates of the Tuberculosis Case Fatality Ratio</a>
</li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
Dashboards
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="http://www.seabbs.co.uk/shiny/ExploreGlobalTB/">Explore Global Tuberculosis</a>
</li>
</ul>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="reference/index.html">
<span class="fa fa-file-code-o"></span>
Functions
</a>
</li>
<li>
<a href="news/index.html">News</a>
</li>
<li>
<a href="https://github.com/seabbs/getTBinR">
<span class="fa fa-github fa-lg"></span>
Github
</a>
</li>
</ul>
</div>
<!--/.nav-collapse -->
</div>
<!--/.container -->
</div>
<!--/.navbar -->
</header><div class="row">
<div class="col-md-9">
<div class="contents">
<div id="get-tb-data-in-r" class="section level1">
<div class="page-header"><h1 class="hasAnchor">
<a href="#get-tb-data-in-r" class="anchor"></a>Get TB Data in R</h1></div>
<p>Quickly and easily import analysis ready TB burden data, from the World Health Orgnaisation (WHO), into R. The aim of the package is to speed up access to high quality TB burden data, using a simple R interface. Generic plotting functions are provided to allow for rapid graphical exploration of the WHO TB data. A shiny dashboard is built in to showcase package functionality. This package is inspired by a blog <a href="https://incidental-ideas.org/2017/03/03/who-tuberculosis-data-ggplot2/">post</a>, which looked at WHO TB incidence rates. See <a href="http://www.who.int/about/copyright/en/">here</a> for the WHO data permissions. For help getting started see the <a href="https://www.samabbott.co.uk/getTBinR/articles/intro.html">Getting Started</a> vignette and for a case study using the package see the <a href="https://www.samabbott.co.uk/getTBinR/articles/case_study_global_trends.html">Exploring Global Trends in Tuberculosis Incidence Rates</a> vignette.</p>
<div id="installation" class="section level2">
<h2 class="hasAnchor">
<a href="#installation" class="anchor"></a>Installation</h2>
<p>Install the CRAN version:</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">install.packages</span>(<span class="st">"getTBinR"</span>)</code></pre></div>
<p>Alternatively install the development version from GitHub:</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="co"># install.packages("devtools")</span>
devtools<span class="op">::</span><span class="kw"><a href="http://www.rdocumentation.org/packages/devtools/topics/install_github">install_github</a></span>(<span class="st">"seabbs/getTBinR"</span>)</code></pre></div>
</div>
<div id="quick-start" class="section level2">
<h2 class="hasAnchor">
<a href="#quick-start" class="anchor"></a>Quick start</h2>
<p>Lets get started quickly by mapping and then plotting TB incidence rates in the United Kingdom. First map global TB incidence rates in 2016 (this will also download and save both the TB burden data and its data dictionary, if they are not found locally, to R’s temporary directory),</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">getTBinR<span class="op">::</span><span class="kw"><a href="https://samabbott.co.uk/getTBinR//reference/map_tb_burden.html">map_tb_burden</a></span>(<span class="dt">metric =</span> <span class="st">"e_inc_100k"</span>,
<span class="dt">year =</span> <span class="dv">2016</span>)
<span class="co">#> Downloading data from: https://extranet.who.int/tme/generateCSV.asp?ds=estimates</span>
<span class="co">#> Saving data to: /tmp/RtmpwVAoLi/TB_burden.rds</span>
<span class="co">#> Downloading data from: https://extranet.who.int/tme/generateCSV.asp?ds=dictionary</span>
<span class="co">#> Saving data to: /tmp/RtmpwVAoLi/TB_data_dict.rds</span>
<span class="co">#> 1 results found for your variable search for e_inc_100k</span></code></pre></div>
<p><img src="man/figure/map-tb-incidence-eur-1.png" width="672"></p>
<p>Then compare TB incidence rates in the UK to TB incidence rates in other countries in the region,</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">getTBinR<span class="op">::</span><span class="kw"><a href="https://samabbott.co.uk/getTBinR//reference/plot_tb_burden_overview.html">plot_tb_burden_overview</a></span>(<span class="dt">metric =</span> <span class="st">"e_inc_100k"</span>,
<span class="dt">countries =</span> <span class="st">"United Kingdom"</span>,
<span class="dt">compare_to_region =</span> <span class="ot">TRUE</span>,
<span class="dt">interactive =</span> <span class="ot">FALSE</span>)
<span class="co">#> Loading data from: /tmp/RtmpwVAoLi/TB_burden.rds</span>
<span class="co">#> Loading data from: /tmp/RtmpwVAoLi/TB_data_dict.rds</span>
<span class="co">#> 1 results found for your variable search for e_inc_100k</span></code></pre></div>
<p><img src="man/figure/plot-tb-incidence-eur-1.png" width="960"></p>
<p>In order to compare the changes in incidence rates over time, in the region, plot the annual percentage change (note that this functionality is currently only available in the development version of the package),</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">getTBinR<span class="op">::</span><span class="kw"><a href="https://samabbott.co.uk/getTBinR//reference/plot_tb_burden_overview.html">plot_tb_burden_overview</a></span>(<span class="dt">metric =</span> <span class="st">"e_inc_100k"</span>,
<span class="dt">countries =</span> <span class="st">"United Kingdom"</span>,
<span class="dt">compare_to_region =</span> <span class="ot">TRUE</span>,
<span class="dt">annual_change =</span> <span class="ot">TRUE</span>,
<span class="dt">interactive =</span> <span class="ot">FALSE</span>)
<span class="co">#> Loading data from: /tmp/RtmpwVAoLi/TB_burden.rds</span>
<span class="co">#> Loading data from: /tmp/RtmpwVAoLi/TB_data_dict.rds</span>
<span class="co">#> 1 results found for your variable search for e_inc_100k</span>
<span class="co">#> Warning: Removed 16 rows containing missing values (geom_point).</span></code></pre></div>
<p><img src="man/figure/plot-tb-incidence-eur-per-1.png" width="960"></p>
<p>Finally plot TB incidence rates over time in the United Kingdom.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">getTBinR<span class="op">::</span><span class="kw"><a href="https://samabbott.co.uk/getTBinR//reference/plot_tb_burden.html">plot_tb_burden</a></span>(<span class="dt">metric =</span> <span class="st">"e_inc_100k"</span>,
<span class="dt">countries =</span> <span class="st">"United Kingdom"</span>,
<span class="dt">facet =</span> <span class="st">"country"</span>,
<span class="dt">interactive =</span> <span class="ot">FALSE</span>)
<span class="co">#> Loading data from: /tmp/RtmpwVAoLi/TB_burden.rds</span>
<span class="co">#> Loading data from: /tmp/RtmpwVAoLi/TB_data_dict.rds</span>
<span class="co">#> 1 results found for your variable search for e_inc_100k</span></code></pre></div>
<p><img src="man/figure/plot-tb-incidence-uk-1.png" width="672"></p>
<p>See <a href="https://www.samabbott.co.uk/getTBinR/reference/index.html">Functions</a> for more details of the functions used (note the fuzzy country matching, <code>map_tb_burden</code>, <code>plot_tb_burden_overview</code> and <code>plot_tb_burden</code> will try to exactly match your country request and if that fails will search for partial matches) and for more package functionality. We could make these plots interactive by specifying <code>interactive = TRUE</code></p>
</div>
<div id="shiny-dashboard" class="section level2">
<h2 class="hasAnchor">
<a href="#shiny-dashboard" class="anchor"></a>Shiny Dashboard</h2>
<p>To explore the package functionality in an interactive session, or to investigate TB without having to code extensively in R, a shiny dashboard has been built into the package. This can either be used locally using,</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">getTBinR<span class="op">::</span><span class="kw"><a href="https://samabbott.co.uk/getTBinR//reference/run_tb_dashboard.html">run_tb_dashboard</a></span>()</code></pre></div>
<p>Or accessed <a href="http://www.seabbs.co.uk/shiny/ExploreGlobalTB">online</a>. Any metric in the WHO data can be explored, with country selection using the built in map, and animation possible by year.</p>
<div class="figure">
<img src="man/img/ExploreGlobalTB.png">
</div>
</div>
<div id="additional-functionality" class="section level2">
<h2 class="hasAnchor">
<a href="#additional-functionality" class="anchor"></a>Additional Functionality</h2>
<p>File an issue <a href="https://github.com/seabbs/getTBinR/issues">here</a> if there is a feature, or a dataset, that you think is missing from the package, or better yet submit a pull request!</p>
</div>
<div id="docker" class="section level2">
<h2 class="hasAnchor">
<a href="#docker" class="anchor"></a>Docker</h2>
<p>This package has been developed in docker based on the <code>rocker/tidyverse</code> image, to access the development environment enter the following at the command line (with an active docker daemon running),</p>
<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash"><span class="ex">docker</span> pull seabbs/gettbinr
<span class="ex">docker</span> run -d -p 8787:8787 -e USER=getTBinR -e PASSWORD=getTBinR --name getTBinR seabbs/gettbinr</code></pre></div>
<p>The rstudio client can be accessed on port <code>8787</code> at <code>localhost</code> (or your machines ip). The default username is getTBinR and the default password is getTBinR.</p>
</div>
</div>
</div>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
<h2 class="hasAnchor">
<a href="#sidebar" class="anchor"></a>Links</h2>
<ul class="list-unstyled">
<li>Download from CRAN at <br><a href="https://cran.r-project.org/package=getTBinR">https://cran.r-project.org/package=getTBinR</a>
</li>
<li>Browse source code at <br><a href="https://github.com/seabbs/getTBinR">https://github.com/seabbs/getTBinR</a>
</li>
<li>Report a bug at <br><a href="https://github.com/seabbs/getTBinR/issues">https://github.com/seabbs/getTBinR/issues</a>
</li>
</ul>
<h2>License</h2>
<p><a href="https://www.r-project.org/Licenses/GPL-3">GPL-3</a> | file <a href="LICENSE.html">LICENSE</a></p>
<h2>Developers</h2>
<ul class="list-unstyled">
<li>Sam Abbott <br><small class="roles"> Author, maintainer </small> </li>
</ul>
<h2>Dev status</h2>
<ul class="list-unstyled">
<li><a href="https://CRAN.R-project.org/package=getTBinR"><img src="http://www.r-pkg.org/badges/version-ago/getTBinR" alt="CRAN_Release_Badge"></a></li>
<li><a href="http://www.rdocumentation.org/packages/getTBinR"><img src="http://www.rdocumentation.org/badges/version/getTBinR" alt="Rdoc"></a></li>
<li><a href="https://travis-ci.org/seabbs/getTBinR"><img src="https://travis-ci.org/seabbs/getTBinR.svg?branch=master" alt="Travis-CI Build Status"></a></li>
<li><a href="https://ci.appveyor.com/project/seabbs/getTBinR"><img src="https://ci.appveyor.com/api/projects/status/github/seabbs/getTBinR?branch=master&svg=true" alt="AppVeyor Build Status"></a></li>
<li><a href="https://codecov.io/github/seabbs/getTBinR?branch=master"><img src="https://img.shields.io/codecov/c/github/seabbs/getTBinR/master.svg" alt="Coverage Status"></a></li>
<li><a href="https://cran.r-project.org/package=getTBinR"><img src="http://cranlogs.r-pkg.org/badges/getTBinR" alt="metacran monthly downloads"></a></li>
<li><a href="https://cran.r-project.org/package=getTBinR"><img src="http://cranlogs.r-pkg.org/badges/grand-total/getTBinR?color=ff69b4" alt="metacran downloads"></a></li>
</ul>
</div>
</div>
<footer><div class="copyright">
<p>Developed by Sam Abbott.</p>
</div>
<div class="pkgdown">
<p>Site built with <a href="http://pkgdown.r-lib.org/">pkgdown</a>.</p>
</div>
</footer>
</div>
</body>
</html>