-
Notifications
You must be signed in to change notification settings - Fork 57
/
Copy path.Rhistory
512 lines (512 loc) · 19.7 KB
/
.Rhistory
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
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
############
learnr, # interactive tutorials in RStudio Tutorial pane
swirl, # interactive tutorials in R console
# project and file management
#############################
here, # file paths relative to R project root folder
rio, # import/export of many types of data
openxlsx, # import/export of multi-sheet Excel workbooks
# package install and management
################################
pacman, # package install/load
renv, # managing versions of packages when working in collaborative groups
remotes, # install from github
# General data management
#########################
tidyverse, # includes many packages for tidy data wrangling and presentation
#dplyr, # data management
#tidyr, # data management
#ggplot2, # data visualization
#stringr, # work with strings and characters
#forcats, # work with factors
#lubridate, # work with dates
#purrr # iteration and working with lists
linelist, # cleaning linelists
naniar, # assessing missing data
# statistics
############
janitor, # tables and data cleaning
gtsummary, # making descriptive and statistical tables
rstatix, # quickly run statistical tests and summaries
broom, # tidy up results from regressions
lmtest, # likelihood-ratio tests
easystats,
# parameters, # alternative to tidy up results from regressions
# see, # alternative to visualise forest plots
# epidemic modeling
###################
epicontacts, # Analysing transmission networks
EpiNow2, # Rt estimation
EpiEstim, # Rt estimation
projections, # Incidence projections
incidence2, # Make epicurves and handle incidence data
i2extras, # Extra functions for the incidence2 package
epitrix, # Useful epi functions
distcrete, # Discrete delay distributions
# plots - general
#################
#ggplot2, # included in tidyverse
cowplot, # combining plots
# patchwork, # combining plots (alternative)
RColorBrewer, # color scales
ggnewscale, # to add additional layers of color schemes
# plots - specific types
########################
DiagrammeR, # diagrams using DOT language
incidence2, # epidemic curves
gghighlight, # highlight a subset
ggrepel, # smart labels
plotly, # interactive graphics
gganimate, # animated graphics
# gis
######
sf, # to manage spatial data using a Simple Feature format
tmap, # to produce simple maps, works for both interactive and static maps
OpenStreetMap, # to add OSM basemap in ggplot map
spdep, # spatial statistics
# routine reports
#################
rmarkdown, # produce PDFs, Word Documents, Powerpoints, and HTML files
reportfactory, # auto-organization of R Markdown outputs
officer, # powerpoints
# dashboards
############
flexdashboard, # convert an R Markdown script into a dashboard
shiny, # interactive web apps
# tables for presentation
#########################
knitr, # R Markdown report generation and html tables
flextable, # HTML tables
#DT, # HTML tables (alternative)
#gt, # HTML tables (alternative)
#huxtable, # HTML tables (alternative)
# phylogenetics
###############
ggtree, # visualization and annotation of trees
ape, # analysis of phylogenetics and evolution
treeio # to visualize phylogenetic files
)
pacman::p_load(rio, # to import data
here, # to locate files
tidyverse, # to clean, handle, and plot the data (includes ggplot2 package)
apyramid, # a package dedicated to creating age pyramids
janitor, # tables and cleaning data
stringr) # working with strings for titles, captions, etc.
pacman::p_load(apyramid)
# Development version of epicontacts (for transmission chains with a time x-axis)
pacman::p_install_gh("reconhub/epicontacts@timeline")
# install/load packages
pacman::p_load(
stringr, # many functions for handling strings
tidyverse, # for optional data manipulation
tools) # alternative for converting to title case
pacman::p_load(
rio, # importing data
here, # relative file pathways
janitor, # data cleaning and tables
lubridate, # working with dates
matchmaker, # dictionary-based cleaning
epikit, # age_categories() function
tidyverse # data management and visualization
)
pacman::p_load(
tidyverse, # data management and visualization
UpSetR, # special package for combination plots
ggupset) # special package for combination plots
pacman::p_load(
rio, # importing data
here, # relative file pathways
janitor, # data cleaning and tables
lubridate, # working with dates
epikit, # age_categories() function
apyramid, # age pyramids
tidyverse, # data manipulation and visualization
RColorBrewer, # color palettes
formattable, # fancy tables
kableExtra # table formatting
)
pacman::p_load(
rio, # to import data
data.table, # to group and clean data
tidyverse, # allows use of pipe (%>%) function in this chapter
here
)
pacman::p_load(
lubridate, # general package for handling and converting dates
parsedate, # has function to "guess" messy dates
aweek, # another option for converting dates to weeks, and weeks to dates
zoo, # additional date/time functions
tidyverse, # data management and visualization
rio) # data import/export
pacman::p_load(
tidyverse, # deduplication, grouping, and slicing functions
janitor, # function for reviewing duplicates
stringr) # for string searches, can be used in "rolling-up" values
pacman::p_load(
rio, # File import
here, # File locator
skimr, # get overview of data
tidyverse, # data management + ggplot2 graphics,
gtsummary, # summary statistics and tests
janitor, # adding totals and percents to tables
flextable, # converting tables to HTML
corrr # correlation analayis for numeric variables
)
pacman::p_load(
DiagrammeR, # for flow diagrams
networkD3, # For alluvial/Sankey diagrams
tidyverse) # data management and visualization
pacman::p_load(
fs, # file/directory interactions
rio, # import/export
here, # relative file pathways
tidyverse) # data management and visualization
pacman::p_load(
rio, # file import/export
here, # relative filepaths
lubridate, # working with dates/epiweeks
aweek, # alternative package for working with dates/epiweeks
incidence2, # epicurves of linelist data
i2extras, # supplement to incidence2
stringr, # search and manipulate character strings
forcats, # working with factors
RColorBrewer, # Color palettes from colorbrewer2.org
tidyverse # data management + ggplot2 graphics
)
pacman::p_load(
rio, # file import/export
here, # relative filepaths
lubridate, # working with dates/epiweeks
aweek, # alternative package for working with dates/epiweeks
incidence2, # epicurves of linelist data
i2extras, # supplement to incidence2
stringr, # search and manipulate character strings
forcats, # working with factors
RColorBrewer, # Color palettes from colorbrewer2.org
tidyverse # data management + ggplot2 graphics
)
pacman::p_load(
rio, # File import
here, # File locator
tidyverse, # Data management + ggplot2 graphics
epicontacts, # Analysing transmission networks
EpiNow2, # Rt estimation
EpiEstim, # Rt estimation
projections, # Incidence projections
incidence2, # Handling incidence data
epitrix, # Useful epi functions
distcrete # Discrete delay distributions
)
pacman::p_load(
rio, # import/export
here, # filepaths
lubridate, # working with dates
forcats, # factors
aweek, # create epiweeks with automatic factor levels
janitor, # tables
tidyverse # data mgmt and viz
)
pacman::p_load(
rio, # data import/export
here, # locate files
tidyverse, # data management and visualization
flexdashboard, # dashboard versions of R Markdown reports
shiny, # interactive figures
plotly # interactive figures
)
pacman::p_load(
tidyverse, # includes ggplot2 and other data management tools
rio, # import/export
here, # file locator
stringr # working with characters
)
pacman::p_load(
tidyverse, # includes ggplot2 and other
rio, # import/export
here, # file locator
stringr, # working with characters
scales, # transform numbers
ggrepel, # smartly-placed labels
gghighlight, # highlight one part of plot
RColorBrewer # color scales
)
pacman::p_load(
rio, # to import data
here, # to locate files
tidyverse, # to clean, handle, and plot the data (includes ggplot2 package)
sf, # to manage spatial data using a Simple Feature format
tmap, # to produce simple maps, works for both interactive and static maps
janitor, # to clean column names
OpenStreetMap, # to add OSM basemap in ggplot map
spdep # spatial statistics
)
pacman::p_load(
tidyverse, # data manipulation and visualization
rio, # importing data
lubridate # working with dates
)
pacman::p_load(
rio, # import/export
here, # filepaths
lubridate, # working with dates
plotly, # interactive plots
scales, # quick percents
tidyverse # data management and visualization
)
pacman::p_load(
rio, # import/export
here, # file locator
purrr, # iteration
grates, # scales in ggplot
tidyverse # data management and visualization
)
pacman::p_load(
rio, # import and export
here, # locate files
tidyverse, # data management and visualisation
RecordLinkage, # probabilistic matches
fastLink # probabilistic matches
)
pacman::p_load(
rio, # import/export
tidyverse, # data mgmt and viz
naniar, # assess and visualize missingness
mice # missing data imputation
)
pacman::p_load(
tidyverse, # for data management and viz
slider, # for calculating moving averages
tidyquant # for calculating moving averages within ggplot
)
pacman::p_load(here, ggplot2, dplyr, ape, ggtree, treeio, ggnewscale)
pacman::p_load(
rio, # import/export
here, # relative file paths
tidyverse, # general data management and visualization
ape, # to import and export phylogenetic files
ggtree, # to visualize phylogenetic files
treeio, # to visualize phylogenetic files
ggnewscale) # to add additional layers of color schemes
pacman::p_load(
rio, # File import
here, # File locator
kableExtra, # Build and manipulate complex tables
tidyverse) # data management + ggplot2 graphics
pacman::p_load(
rio, # File import
here, # File locator
tidyverse, # data management + ggplot2 graphics,
stringr, # manipulate text strings
purrr, # loop over objects in a tidy way
gtsummary, # summary statistics and tests
broom, # tidy up results from regressions
lmtest, # likelihood-ratio tests
parameters, # alternative to tidy up results from regressions
see # alternative to visualise forest plots
)
# Install and load the latest version of the package from Github
pacman::p_load_current_gh("reconverse/reportfactory")
pacman::p_load(tinytex) # install tinytex package
pacman::p_load(rmarkdown)
## load packages from CRAN
pacman::p_load(here, # File locator
randomNames, # Generate random names
dplyr, # Data management
tidyr, # Switching from wide to long
ggplot2, # Ggplot2 graphics
metR, # Filled contours used with ggplot2
gridExtra, # Plotting ggplot2 graphs side by side
DT # Interactive tables
)
pacman::p_load(shiny)
pacman::p_load(
rio, # import/export data
here, # locate files
tidyverse, # data management and visualization
stringr, # cleaning characters and strings
frailtypack, # needed for dsr, for frailty models
dsr, # standardise rates
PHEindicatormethods) # alternative for rate standardisation
## load packages from CRAN
pacman::p_load(rio, # File import
here, # File locator
tidyverse, # data management + ggplot2 graphics
tsibble, # handle time series datasets
survey, # for survey functions
srvyr, # dplyr wrapper for survey package
gtsummary, # wrapper for survey package to produce tables
apyramid, # a package dedicated to creating age pyramids
patchwork, # for combining ggplots
ggforce # for alluvial/sankey plots
)
## load packages from github
pacman::p_load_gh(
"R4EPI/sitrep" # for observation time / weighting functions
)
# install/load the different packages needed for this page
pacman::p_load(
survival, # survival analysis
survminer, # survival analysis
rio, # importing data
here, # relative file pathways
janitor, # tabulations
SemiCompRisks, # dataset examples and advanced tools for working with Semi-Competing Risks data
tidyverse, # data manipulation and visualization
Epi, # stat analyses in Epi
survival, # survival analysis
survminer # survival analysis: advanced KM curves
)
pacman::p_load(
rio, # File import
here, # File locator
skimr, # get overview of data
tidyverse, # data management + ggplot2 graphics
gtsummary, # summary statistics and tests
rstatix, # summary statistics and statistical tests
janitor, # adding totals and percents to tables
scales, # easily convert proportions to percents
flextable # converting tables to pretty images
)
pacman::p_load(
rio, # import/export
here, # file pathways
flextable, # make HTML tables
officer, # helper functions for tables
tidyverse) # data management, summary, and visualization
pacman::p_load(rio, # File import
here, # File locator
tidyverse, # data management + ggplot2 graphics
tsibble, # handle time series datasets
slider, # for calculating moving averages
imputeTS, # for filling in missing values
feasts, # for time series decomposition and autocorrelation
forecast, # fit sin and cosin terms to data (note: must load after feasts)
trending, # fit and assess models
tmaptools, # for getting geocoordinates (lon/lat) based on place names
ecmwfr, # for interacting with copernicus sateliate CDS API
stars, # for reading in .nc (climate data) files
units, # for defining units of measurement (climate data)
yardstick, # for looking at model accuracy
surveillance # for aberration detection
)
# install development version of epicontacts
if(
!"epicontacts" %in% rownames(installed.packages()) |
packageVersion("epicontacts") != "1.2.0"
) remotes::install_github("reconhub/epicontacts@timeline")
## install and load packages
pacman::p_load(tidyverse,
#epicontacts,
magrittr, here, webshot, visNetwork)
pacman::p_load(
rio, # File import
here, # File locator
tidyverse, # Data management + ggplot2 graphics
remotes # Package installation from github
)
pacman::p_load(
rio, # File import
here, # File locator
skimr, # get overview of data
tidyverse, # data management + ggplot2 graphics,
gtsummary, # summary statistics and tests
janitor, # adding totals and percents to tables
scales, # easily convert proportions to percents
flextable, # converting tables to HTML
purrr, #makes functional programming easier
readr, #to read csv files
highcharter #to create highchart object and draw particular plot
)
# PREVIEW ONLY ONE OR SOME PAGES
# !!! NOTE - sometimes running this command renders the entire book!
# !!! In this case, just stop the rendering and re-run the command. It should work the second time.
# Edit which pages to include in "_small_bookdown.yml"
# To view, navigate to the "preview" folder and open "index.html"
bookdown::render_book(
output_format = 'bookdown::bs4_book',
config_file = "_small_bookdown.yml")
# PREVIEW ONLY ONE OR SOME PAGES
# !!! NOTE - sometimes running this command renders the entire book!
# !!! In this case, just stop the rendering and re-run the command. It should work the second time.
# Edit which pages to include in "_small_bookdown.yml"
# To view, navigate to the "preview" folder and open "index.html"
bookdown::render_book(
output_format = 'bookdown::bs4_book',
config_file = "_small_bookdown.yml")
# Use these commands to actually render the handbook
# See format and content choices below
# test
################################################################################
# BS4 BOOKDOWN STYLE (WEBSITE VERSION) ##
#########################################
# WHOLE HANDBOOK
# for online viewing only - not available as a self-contained file
bookdown::render_book(
output_format = 'bookdown::bs4_book',
config_file = "_bookdown.yml")
remove.packages("bookdown")
install.packages("bookdown")
install.packages("bookdown")
# PREVIEW ONLY ONE OR SOME PAGES
# !!! NOTE - sometimes running this command renders the entire book!
# !!! In this case, just stop the rendering and re-run the command. It should work the second time.
# Edit which pages to include in "_small_bookdown.yml"
# To view, navigate to the "preview" folder and open "index.html"
bookdown::render_book(
output_format = 'bookdown::bs4_book',
config_file = "_small_bookdown.yml")
# PREVIEW ONLY ONE OR SOME PAGES
# !!! NOTE - sometimes running this command renders the entire book!
# !!! In this case, just stop the rendering and re-run the command. It should work the second time.
# Edit which pages to include in "_small_bookdown.yml"
# To view, navigate to the "preview" folder and open "index.html"
bookdown::render_book(
output_format = 'bookdown::bs4_book',
config_file = "_small_bookdown.yml")
# PREVIEW ONLY ONE OR SOME PAGES
# !!! NOTE - sometimes running this command renders the entire book!
# !!! In this case, just stop the rendering and re-run the command. It should work the second time.
# Edit which pages to include in "_small_bookdown.yml"
# To view, navigate to the "preview" folder and open "index.html"
bookdown::render_book(
output_format = 'bookdown::bs4_book',
config_file = "_small_bookdown.yml")
# PREVIEW ONLY ONE OR SOME PAGES
# !!! NOTE - sometimes running this command renders the entire book!
# !!! In this case, just stop the rendering and re-run the command. It should work the second time.
# Edit which pages to include in "_small_bookdown.yml"
# To view, navigate to the "preview" folder and open "index.html"
bookdown::render_book(
output_format = 'bookdown::bs4_book',
config_file = "_small_bookdown.yml")
# Use these commands to actually render the handbook
# See format and content choices below
# test
################################################################################
# BS4 BOOKDOWN STYLE (WEBSITE VERSION) ##
#########################################
# WHOLE HANDBOOK
# for online viewing only - not available as a self-contained file
bookdown::render_book(
output_format = 'bookdown::bs4_book',
config_file = "_bookdown.yml")
# PREVIEW ONLY ONE OR SOME PAGES
# !!! NOTE - sometimes running this command renders the entire book!
# !!! In this case, just stop the rendering and re-run the command. It should work the second time.
# Edit which pages to include in "_small_bookdown.yml"
# To view, navigate to the "preview" folder and open "index.html"
bookdown::render_book(
output_format = 'bookdown::bs4_book',
config_file = "_small_bookdown.yml")
# Use these commands to actually render the handbook
# See format and content choices below
# test
################################################################################
# BS4 BOOKDOWN STYLE (WEBSITE VERSION) ##
#########################################
# WHOLE HANDBOOK
# for online viewing only - not available as a self-contained file
bookdown::render_book(
output_format = 'bookdown::bs4_book',
config_file = "_bookdown.yml")
renv::status()