forked from csgillespie/efficientR
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlook-at-the-source-code.html
474 lines (407 loc) · 36.3 KB
/
look-at-the-source-code.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
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
<!DOCTYPE html>
<html >
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Efficient R programming</title>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<meta name="description" content="Efficient R programming">
<meta name="generator" content="bookdown 0.0.70 and GitBook 2.6.7">
<meta property="og:title" content="Efficient R programming" />
<meta property="og:type" content="book" />
<meta property="og:image" content="figures/full.png" />
<meta name="twitter:card" content="summary" />
<meta name="twitter:title" content="Efficient R programming" />
<meta name="twitter:image" content="figures/full.png" />
<meta name="author" content="Colin Gillespie and Robin Lovelace">
<meta name="date" content="2016-05-04">
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
TeX: { equationNumbers: { autoNumber: "AMS" } }
});
</script>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="prev" href="code.html">
<script src="libs/jquery-2.2.3/jquery.min.js"></script>
<link href="libs/gitbook-2.6.7/css/style.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-bookdown.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-highlight.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-search.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-fontsettings.css" rel="stylesheet" />
<style type="text/css">
div.sourceCode { overflow-x: auto; }
table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {
margin: 0; padding: 0; vertical-align: baseline; border: none; }
table.sourceCode { width: 100%; line-height: 100%; }
td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }
td.sourceCode { padding-left: 5px; }
code > span.kw { color: #007020; font-weight: bold; } /* Keyword */
code > span.dt { color: #902000; } /* DataType */
code > span.dv { color: #40a070; } /* DecVal */
code > span.bn { color: #40a070; } /* BaseN */
code > span.fl { color: #40a070; } /* Float */
code > span.ch { color: #4070a0; } /* Char */
code > span.st { color: #4070a0; } /* String */
code > span.co { color: #60a0b0; font-style: italic; } /* Comment */
code > span.ot { color: #007020; } /* Other */
code > span.al { color: #ff0000; font-weight: bold; } /* Alert */
code > span.fu { color: #06287e; } /* Function */
code > span.er { color: #ff0000; font-weight: bold; } /* Error */
code > span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
code > span.cn { color: #880000; } /* Constant */
code > span.sc { color: #4070a0; } /* SpecialChar */
code > span.vs { color: #4070a0; } /* VerbatimString */
code > span.ss { color: #bb6688; } /* SpecialString */
code > span.im { } /* Import */
code > span.va { color: #19177c; } /* Variable */
code > span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
code > span.op { color: #666666; } /* Operator */
code > span.bu { } /* BuiltIn */
code > span.ex { } /* Extension */
code > span.pp { color: #bc7a00; } /* Preprocessor */
code > span.at { color: #7d9029; } /* Attribute */
code > span.do { color: #ba2121; font-style: italic; } /* Documentation */
code > span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
code > span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
</style>
<link rel="stylesheet" href="css/style.css" type="text/css" />
<link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body>
<div class="book without-animation with-summary font-size-2 font-family-1" data-basepath=".">
<div class="book-summary">
<nav role="navigation">
<ul class="summary">
<li><a href="./">Efficient R programming</a></li>
<li class="divider"></li>
<li class="chapter" data-level="1" data-path="index.html"><a href="index.html"><i class="fa fa-check"></i><b>1</b> Introduction (Place holder page for preface)</a><ul>
<li class="chapter" data-level="1.1" data-path="package-dependencies.html"><a href="package-dependencies.html"><i class="fa fa-check"></i><b>1.1</b> Package Dependencies</a></li>
</ul></li>
<li class="chapter" data-level="2" data-path="efficient-set-up.html"><a href="efficient-set-up.html"><i class="fa fa-check"></i><b>2</b> Efficient set-up</a><ul>
<li class="chapter" data-level="2.1" data-path="top-5-tips-for-an-efficient-r-set-up.html"><a href="top-5-tips-for-an-efficient-r-set-up.html"><i class="fa fa-check"></i><b>2.1</b> Top 5 tips for an efficient R set-up</a></li>
<li class="chapter" data-level="2.2" data-path="operating-system.html"><a href="operating-system.html"><i class="fa fa-check"></i><b>2.2</b> Operating system</a><ul>
<li class="chapter" data-level="2.2.1" data-path="operating-system.html"><a href="operating-system.html#operating-system-and-resource-monitoring"><i class="fa fa-check"></i><b>2.2.1</b> Operating system and resource monitoring</a></li>
</ul></li>
<li class="chapter" data-level="2.3" data-path="r-version.html"><a href="r-version.html"><i class="fa fa-check"></i><b>2.3</b> R version</a><ul>
<li class="chapter" data-level="2.3.1" data-path="r-version.html"><a href="r-version.html#installing-r"><i class="fa fa-check"></i><b>2.3.1</b> Installing R</a></li>
<li class="chapter" data-level="2.3.2" data-path="r-version.html"><a href="r-version.html#updating-r"><i class="fa fa-check"></i><b>2.3.2</b> Updating R</a></li>
<li class="chapter" data-level="2.3.3" data-path="r-version.html"><a href="r-version.html#installing-r-packages"><i class="fa fa-check"></i><b>2.3.3</b> Installing R packages</a></li>
<li class="chapter" data-level="2.3.4" data-path="r-version.html"><a href="r-version.html#deps"><i class="fa fa-check"></i><b>2.3.4</b> Installing R packages with dependencies</a></li>
<li class="chapter" data-level="2.3.5" data-path="r-version.html"><a href="r-version.html#updating-r-packages"><i class="fa fa-check"></i><b>2.3.5</b> Updating R packages</a></li>
</ul></li>
<li class="chapter" data-level="2.4" data-path="r-startup.html"><a href="r-startup.html"><i class="fa fa-check"></i><b>2.4</b> R startup</a><ul>
<li class="chapter" data-level="2.4.1" data-path="r-startup.html"><a href="r-startup.html#r-startup-arguments"><i class="fa fa-check"></i><b>2.4.1</b> R startup arguments</a></li>
<li class="chapter" data-level="2.4.2" data-path="r-startup.html"><a href="r-startup.html#an-overview-of-rs-startup-files"><i class="fa fa-check"></i><b>2.4.2</b> An overview of R’s startup files</a></li>
<li class="chapter" data-level="2.4.3" data-path="r-startup.html"><a href="r-startup.html#the-location-of-startup-files"><i class="fa fa-check"></i><b>2.4.3</b> The location of startup files</a></li>
<li class="chapter" data-level="2.4.4" data-path="r-startup.html"><a href="r-startup.html#rprofile"><i class="fa fa-check"></i><b>2.4.4</b> The <code>.Rprofile</code> file</a></li>
<li class="chapter" data-level="2.4.5" data-path="r-startup.html"><a href="r-startup.html#example-.rprofile-settings"><i class="fa fa-check"></i><b>2.4.5</b> Example <code>.Rprofile</code> settings</a></li>
<li class="chapter" data-level="2.4.6" data-path="r-startup.html"><a href="r-startup.html#renviron"><i class="fa fa-check"></i><b>2.4.6</b> The <code>.Renviron</code> file</a></li>
</ul></li>
<li class="chapter" data-level="2.5" data-path="rstudio.html"><a href="rstudio.html"><i class="fa fa-check"></i><b>2.5</b> RStudio</a><ul>
<li class="chapter" data-level="2.5.1" data-path="rstudio.html"><a href="rstudio.html#install-rstudio"><i class="fa fa-check"></i><b>2.5.1</b> Installing and updating RStudio</a></li>
<li class="chapter" data-level="2.5.2" data-path="rstudio.html"><a href="rstudio.html#window-pane-layout"><i class="fa fa-check"></i><b>2.5.2</b> Window pane layout</a></li>
<li class="chapter" data-level="2.5.3" data-path="rstudio.html"><a href="rstudio.html#exercises-3"><i class="fa fa-check"></i><b>2.5.3</b> Exercises</a></li>
<li class="chapter" data-level="2.5.4" data-path="rstudio.html"><a href="rstudio.html#rstudio-options"><i class="fa fa-check"></i><b>2.5.4</b> RStudio options</a></li>
<li class="chapter" data-level="2.5.5" data-path="rstudio.html"><a href="rstudio.html#auto-completion"><i class="fa fa-check"></i><b>2.5.5</b> Auto-completion</a></li>
<li class="chapter" data-level="2.5.6" data-path="rstudio.html"><a href="rstudio.html#keyboard-shortcuts"><i class="fa fa-check"></i><b>2.5.6</b> Keyboard shortcuts</a></li>
<li class="chapter" data-level="2.5.7" data-path="rstudio.html"><a href="rstudio.html#object-display-and-output-table"><i class="fa fa-check"></i><b>2.5.7</b> Object display and output table</a></li>
<li class="chapter" data-level="2.5.8" data-path="rstudio.html"><a href="rstudio.html#project-management"><i class="fa fa-check"></i><b>2.5.8</b> Project management</a></li>
<li class="chapter" data-level="2.5.9" data-path="rstudio.html"><a href="rstudio.html#exercises-4"><i class="fa fa-check"></i><b>2.5.9</b> Exercises</a></li>
</ul></li>
<li class="chapter" data-level="2.6" data-path="blas-and-alternative-r-interpreters.html"><a href="blas-and-alternative-r-interpreters.html"><i class="fa fa-check"></i><b>2.6</b> BLAS and alternative R interpreters</a><ul>
<li class="chapter" data-level="2.6.1" data-path="blas-and-alternative-r-interpreters.html"><a href="blas-and-alternative-r-interpreters.html#testing-performance-gains-from-blas"><i class="fa fa-check"></i><b>2.6.1</b> Testing performance gains from BLAS</a></li>
<li class="chapter" data-level="2.6.2" data-path="blas-and-alternative-r-interpreters.html"><a href="blas-and-alternative-r-interpreters.html#revolution-r"><i class="fa fa-check"></i><b>2.6.2</b> Revolution R</a></li>
<li class="chapter" data-level="2.6.3" data-path="blas-and-alternative-r-interpreters.html"><a href="blas-and-alternative-r-interpreters.html#other-interpreters"><i class="fa fa-check"></i><b>2.6.3</b> Other interpreters</a></li>
<li class="chapter" data-level="2.6.4" data-path="blas-and-alternative-r-interpreters.html"><a href="blas-and-alternative-r-interpreters.html#useful-blasbenchmarking-resources"><i class="fa fa-check"></i><b>2.6.4</b> Useful BLAS/benchmarking resources</a></li>
<li class="chapter" data-level="2.6.5" data-path="blas-and-alternative-r-interpreters.html"><a href="blas-and-alternative-r-interpreters.html#exercises-5"><i class="fa fa-check"></i><b>2.6.5</b> Exercises</a></li>
</ul></li>
</ul></li>
<li class="chapter" data-level="3" data-path="programming.html"><a href="programming.html"><i class="fa fa-check"></i><b>3</b> Efficient programming</a><ul>
<li class="chapter" data-level="3.1" data-path="general-advice.html"><a href="general-advice.html"><i class="fa fa-check"></i><b>3.1</b> General advice</a><ul>
<li class="chapter" data-level="3.1.1" data-path="general-advice.html"><a href="general-advice.html#memory-allocation"><i class="fa fa-check"></i><b>3.1.1</b> Memory allocation</a></li>
<li class="chapter" data-level="3.1.2" data-path="general-advice.html"><a href="general-advice.html#vectorised-code"><i class="fa fa-check"></i><b>3.1.2</b> Vectorised code</a></li>
<li class="chapter" data-level="" data-path="general-advice.html"><a href="general-advice.html#exercise-1"><i class="fa fa-check"></i>Exercise</a></li>
<li class="chapter" data-level="3.1.3" data-path="general-advice.html"><a href="general-advice.html#type-consistency"><i class="fa fa-check"></i><b>3.1.3</b> Type consistency</a></li>
<li class="chapter" data-level="3.1.4" data-path="general-advice.html"><a href="general-advice.html#invisible-returns"><i class="fa fa-check"></i><b>3.1.4</b> Invisible returns</a></li>
</ul></li>
<li class="chapter" data-level="3.2" data-path="factors.html"><a href="factors.html"><i class="fa fa-check"></i><b>3.2</b> Factors</a><ul>
<li class="chapter" data-level="3.2.1" data-path="factors.html"><a href="factors.html#example-months-of-the-year"><i class="fa fa-check"></i><b>3.2.1</b> Example: Months of the year</a></li>
<li class="chapter" data-level="3.2.2" data-path="factors.html"><a href="factors.html#example-graphics"><i class="fa fa-check"></i><b>3.2.2</b> Example: Graphics</a></li>
<li class="chapter" data-level="3.2.3" data-path="factors.html"><a href="factors.html#example-analysis-of-variance"><i class="fa fa-check"></i><b>3.2.3</b> Example: Analysis of variance</a></li>
<li class="chapter" data-level="3.2.4" data-path="factors.html"><a href="factors.html#example-data-input"><i class="fa fa-check"></i><b>3.2.4</b> Example: data input</a></li>
<li class="chapter" data-level="3.2.5" data-path="factors.html"><a href="factors.html#example-factors-are-not-character-vectors"><i class="fa fa-check"></i><b>3.2.5</b> Example: Factors are not character vectors</a></li>
</ul></li>
<li class="chapter" data-level="3.3" data-path="S3.html"><a href="S3.html"><i class="fa fa-check"></i><b>3.3</b> S3 objects</a></li>
<li class="chapter" data-level="3.4" data-path="caching-variables.html"><a href="caching-variables.html"><i class="fa fa-check"></i><b>3.4</b> Caching variables</a><ul>
<li class="chapter" data-level="3.4.1" data-path="caching-variables.html"><a href="caching-variables.html#function-closures"><i class="fa fa-check"></i><b>3.4.1</b> Function closures</a></li>
</ul></li>
<li class="chapter" data-level="3.5" data-path="the-byte-compiler.html"><a href="the-byte-compiler.html"><i class="fa fa-check"></i><b>3.5</b> The byte compiler</a><ul>
<li class="chapter" data-level="3.5.1" data-path="the-byte-compiler.html"><a href="the-byte-compiler.html#example-the-mean-function"><i class="fa fa-check"></i><b>3.5.1</b> Example: the mean function</a></li>
<li class="chapter" data-level="3.5.2" data-path="the-byte-compiler.html"><a href="the-byte-compiler.html#compiling-code"><i class="fa fa-check"></i><b>3.5.2</b> Compiling code</a></li>
</ul></li>
<li class="chapter" data-level="3.6" data-path="parallel-computing.html"><a href="parallel-computing.html"><i class="fa fa-check"></i><b>3.6</b> Parallel computing</a><ul>
<li class="chapter" data-level="3.6.1" data-path="parallel-computing.html"><a href="parallel-computing.html#parallel-versions-of-apply-functions"><i class="fa fa-check"></i><b>3.6.1</b> Parallel versions of apply functions</a></li>
<li class="chapter" data-level="3.6.2" data-path="parallel-computing.html"><a href="parallel-computing.html#example-snakes-and-ladders"><i class="fa fa-check"></i><b>3.6.2</b> Example: Snakes and Ladders</a></li>
<li class="chapter" data-level="3.6.3" data-path="parallel-computing.html"><a href="parallel-computing.html#exit-functions-with-care"><i class="fa fa-check"></i><b>3.6.3</b> Exit functions with care</a></li>
<li class="chapter" data-level="3.6.4" data-path="parallel-computing.html"><a href="parallel-computing.html#process-forking"><i class="fa fa-check"></i><b>3.6.4</b> Process forking</a></li>
</ul></li>
</ul></li>
<li class="chapter" data-level="4" data-path="efficient-workflow.html"><a href="efficient-workflow.html"><i class="fa fa-check"></i><b>4</b> Efficient workflow</a><ul>
<li class="chapter" data-level="4.1" data-path="project-planning.html"><a href="project-planning.html"><i class="fa fa-check"></i><b>4.1</b> Project planning</a><ul>
<li class="chapter" data-level="4.1.1" data-path="project-planning.html"><a href="project-planning.html#chunking-your-work"><i class="fa fa-check"></i><b>4.1.1</b> ‘Chunking’ your work</a></li>
<li class="chapter" data-level="4.1.2" data-path="project-planning.html"><a href="project-planning.html#smart"><i class="fa fa-check"></i><b>4.1.2</b> Making your workflow SMART</a></li>
<li class="chapter" data-level="4.1.3" data-path="project-planning.html"><a href="project-planning.html#r-packages-for-planning"><i class="fa fa-check"></i><b>4.1.3</b> R packages for planning</a></li>
<li class="chapter" data-level="4.1.4" data-path="project-planning.html"><a href="project-planning.html#exercises-9"><i class="fa fa-check"></i><b>4.1.4</b> Exercises</a></li>
</ul></li>
<li class="chapter" data-level="4.2" data-path="pkgs.html"><a href="pkgs.html"><i class="fa fa-check"></i><b>4.2</b> Package selection</a></li>
<li class="chapter" data-level="4.3" data-path="importing-data.html"><a href="importing-data.html"><i class="fa fa-check"></i><b>4.3</b> Importing data</a><ul>
<li class="chapter" data-level="4.3.1" data-path="importing-data.html"><a href="importing-data.html#fread"><i class="fa fa-check"></i><b>4.3.1</b> Fast data reading</a></li>
<li class="chapter" data-level="4.3.2" data-path="importing-data.html"><a href="importing-data.html#preprocessing-outside-r"><i class="fa fa-check"></i><b>4.3.2</b> Preprocessing outside R</a></li>
<li class="chapter" data-level="4.3.3" data-path="importing-data.html"><a href="importing-data.html#working-with-databases"><i class="fa fa-check"></i><b>4.3.3</b> Working with databases</a></li>
</ul></li>
<li class="chapter" data-level="4.4" data-path="tidying-data-with-tidyr.html"><a href="tidying-data-with-tidyr.html"><i class="fa fa-check"></i><b>4.4</b> Tidying data with tidyr</a></li>
<li class="chapter" data-level="4.5" data-path="dplyr.html"><a href="dplyr.html"><i class="fa fa-check"></i><b>4.5</b> Data processing with dplyr</a><ul>
<li class="chapter" data-level="4.5.1" data-path="dplyr.html"><a href="dplyr.html#renaming-columns"><i class="fa fa-check"></i><b>4.5.1</b> Renaming columns</a></li>
<li class="chapter" data-level="4.5.2" data-path="dplyr.html"><a href="dplyr.html#changing-column-classes"><i class="fa fa-check"></i><b>4.5.2</b> Changing column classes</a></li>
<li class="chapter" data-level="4.5.3" data-path="dplyr.html"><a href="dplyr.html#filtering-rows"><i class="fa fa-check"></i><b>4.5.3</b> Filtering rows</a></li>
<li class="chapter" data-level="4.5.4" data-path="dplyr.html"><a href="dplyr.html#filtering-columns"><i class="fa fa-check"></i><b>4.5.4</b> Filtering columns</a></li>
<li class="chapter" data-level="4.5.5" data-path="dplyr.html"><a href="dplyr.html#data-aggregation"><i class="fa fa-check"></i><b>4.5.5</b> Data aggregation</a></li>
<li class="chapter" data-level="4.5.6" data-path="dplyr.html"><a href="dplyr.html#chaining-operations"><i class="fa fa-check"></i><b>4.5.6</b> Chaining operations</a></li>
</ul></li>
<li class="chapter" data-level="4.6" data-path="data-processing-with-data-table.html"><a href="data-processing-with-data-table.html"><i class="fa fa-check"></i><b>4.6</b> Data processing with data.table</a></li>
<li class="chapter" data-level="4.7" data-path="publication.html"><a href="publication.html"><i class="fa fa-check"></i><b>4.7</b> Publication</a><ul>
<li class="chapter" data-level="4.7.1" data-path="publication.html"><a href="publication.html#dynamic-documents-with-knitr"><i class="fa fa-check"></i><b>4.7.1</b> Dynamic documents with knitr</a></li>
<li class="chapter" data-level="4.7.2" data-path="publication.html"><a href="publication.html#r-packages"><i class="fa fa-check"></i><b>4.7.2</b> R packages</a></li>
</ul></li>
</ul></li>
<li class="chapter" data-level="5" data-path="efficient-data-carpentry.html"><a href="efficient-data-carpentry.html"><i class="fa fa-check"></i><b>5</b> Efficient data carpentry</a></li>
<li class="chapter" data-level="6" data-path="efficient-visualisation.html"><a href="efficient-visualisation.html"><i class="fa fa-check"></i><b>6</b> Efficient visualisation</a><ul>
<li class="chapter" data-level="6.1" data-path="rough-outline.html"><a href="rough-outline.html"><i class="fa fa-check"></i><b>6.1</b> Rough outline</a></li>
<li class="chapter" data-level="6.2" data-path="cairo-type.html"><a href="cairo-type.html"><i class="fa fa-check"></i><b>6.2</b> Cairo type</a></li>
</ul></li>
<li class="chapter" data-level="7" data-path="efficient-performance.html"><a href="efficient-performance.html"><i class="fa fa-check"></i><b>7</b> Efficient performance</a><ul>
<li class="chapter" data-level="7.1" data-path="efficient-base-r.html"><a href="efficient-base-r.html"><i class="fa fa-check"></i><b>7.1</b> Efficient base R</a><ul>
<li><a href="efficient-base-r.html#the-if-vs-ifelse-functions">The <code>if</code> vs <code>ifelse</code> functions</a></li>
<li class="chapter" data-level="" data-path="efficient-base-r.html"><a href="efficient-base-r.html#sorting-and-ordering"><i class="fa fa-check"></i>Sorting and ordering</a></li>
<li class="chapter" data-level="" data-path="efficient-base-r.html"><a href="efficient-base-r.html#reversing-elements"><i class="fa fa-check"></i>Reversing elements</a></li>
<li><a href="efficient-base-r.html#which-indices-are-true">Which indices are <code>TRUE</code> </a></li>
<li class="chapter" data-level="" data-path="efficient-base-r.html"><a href="efficient-base-r.html#converting-factors-to-numerics"><i class="fa fa-check"></i>Converting factors to numerics</a></li>
<li class="chapter" data-level="" data-path="efficient-base-r.html"><a href="efficient-base-r.html#string-concatenation"><i class="fa fa-check"></i>String concatenation</a></li>
<li class="chapter" data-level="" data-path="efficient-base-r.html"><a href="efficient-base-r.html#logical-and-and-or"><i class="fa fa-check"></i>Logical AND and OR</a></li>
<li class="chapter" data-level="" data-path="efficient-base-r.html"><a href="efficient-base-r.html#row-and-column-operations"><i class="fa fa-check"></i>Row and column operations</a></li>
<li class="chapter" data-level="7.1.1" data-path="efficient-base-r.html"><a href="efficient-base-r.html#is.na-and-anyna"><i class="fa fa-check"></i><b>7.1.1</b> <code>is.na</code> and <code class="unnumbered">anyNA</code></a></li>
<li class="chapter" data-level="" data-path="efficient-base-r.html"><a href="efficient-base-r.html#matrices"><i class="fa fa-check"></i>Matrices</a></li>
<li class="chapter" data-level="" data-path="efficient-base-r.html"><a href="efficient-base-r.html#efficient-data-structures"><i class="fa fa-check"></i>Efficient data structures</a></li>
<li class="chapter" data-level="" data-path="efficient-base-r.html"><a href="efficient-base-r.html#the-integer-data-type"><i class="fa fa-check"></i>The integer data type</a></li>
</ul></li>
<li class="chapter" data-level="7.2" data-path="code-profiling.html"><a href="code-profiling.html"><i class="fa fa-check"></i><b>7.2</b> Code profiling</a><ul>
<li class="chapter" data-level="7.2.1" data-path="code-profiling.html"><a href="code-profiling.html#getting-started-with-profvis"><i class="fa fa-check"></i><b>7.2.1</b> Getting started with <strong>profvis</strong></a></li>
<li class="chapter" data-level="7.2.2" data-path="code-profiling.html"><a href="code-profiling.html#example-monopoly-simulation"><i class="fa fa-check"></i><b>7.2.2</b> Example: Monopoly Simulation</a></li>
</ul></li>
<li class="chapter" data-level="7.3" data-path="rcpp.html"><a href="rcpp.html"><i class="fa fa-check"></i><b>7.3</b> Rcpp</a><ul>
<li class="chapter" data-level="7.3.1" data-path="rcpp.html"><a href="rcpp.html#pre-requisites"><i class="fa fa-check"></i><b>7.3.1</b> Pre-requisites</a></li>
<li class="chapter" data-level="7.3.2" data-path="rcpp.html"><a href="rcpp.html#simple-c"><i class="fa fa-check"></i><b>7.3.2</b> A simple C++ function</a></li>
<li class="chapter" data-level="7.3.3" data-path="rcpp.html"><a href="rcpp.html#cppfunction"><i class="fa fa-check"></i><b>7.3.3</b> The cppFunction command</a></li>
<li class="chapter" data-level="7.3.4" data-path="rcpp.html"><a href="rcpp.html#c-types"><i class="fa fa-check"></i><b>7.3.4</b> C++ data types</a></li>
<li class="chapter" data-level="7.3.5" data-path="rcpp.html"><a href="rcpp.html#sourcecpp"><i class="fa fa-check"></i><b>7.3.5</b> The <code>sourceCpp</code> function</a></li>
<li class="chapter" data-level="7.3.6" data-path="rcpp.html"><a href="rcpp.html#vectors-and-loops"><i class="fa fa-check"></i><b>7.3.6</b> Vectors and loops</a></li>
<li class="chapter" data-level="7.3.7" data-path="rcpp.html"><a href="rcpp.html#sugar"><i class="fa fa-check"></i><b>7.3.7</b> C++ with sugar on top</a></li>
<li class="chapter" data-level="7.3.8" data-path="rcpp.html"><a href="rcpp.html#rcpp-resources"><i class="fa fa-check"></i><b>7.3.8</b> Rcpp resources</a></li>
</ul></li>
</ul></li>
<li class="chapter" data-level="8" data-path="efficient-hardware.html"><a href="efficient-hardware.html"><i class="fa fa-check"></i><b>8</b> Efficient hardware</a><ul>
<li class="chapter" data-level="8.1" data-path="background-what-is-a-byte.html"><a href="background-what-is-a-byte.html"><i class="fa fa-check"></i><b>8.1</b> Background: what is a byte?</a></li>
<li class="chapter" data-level="8.2" data-path="ram.html"><a href="ram.html"><i class="fa fa-check"></i><b>8.2</b> Random access memory: RAM</a></li>
<li class="chapter" data-level="8.3" data-path="hard-drives-hdd-vs-ssd.html"><a href="hard-drives-hdd-vs-ssd.html"><i class="fa fa-check"></i><b>8.3</b> Hard drives: HDD vs SSD</a></li>
<li class="chapter" data-level="8.4" data-path="operating-systems-32-bit-or-64-bit.html"><a href="operating-systems-32-bit-or-64-bit.html"><i class="fa fa-check"></i><b>8.4</b> Operating systems: 32-bit or 64-bit</a></li>
<li class="chapter" data-level="8.5" data-path="central-processing-unit-cpu.html"><a href="central-processing-unit-cpu.html"><i class="fa fa-check"></i><b>8.5</b> Central processing unit (CPU)</a></li>
<li class="chapter" data-level="8.6" data-path="cloud-computing.html"><a href="cloud-computing.html"><i class="fa fa-check"></i><b>8.6</b> Cloud computing</a><ul>
<li class="chapter" data-level="8.6.1" data-path="cloud-computing.html"><a href="cloud-computing.html#amazon-ec2"><i class="fa fa-check"></i><b>8.6.1</b> Amazon EC2</a></li>
</ul></li>
</ul></li>
<li class="chapter" data-level="9" data-path="efficient-collaboration.html"><a href="efficient-collaboration.html"><i class="fa fa-check"></i><b>9</b> Efficient Collaboration</a><ul>
<li class="chapter" data-level="9.1" data-path="coding-style.html"><a href="coding-style.html"><i class="fa fa-check"></i><b>9.1</b> Coding style</a><ul>
<li class="chapter" data-level="9.1.1" data-path="coding-style.html"><a href="coding-style.html#reformatting-code-with-rstudio"><i class="fa fa-check"></i><b>9.1.1</b> Reformatting code with RStudio</a></li>
<li class="chapter" data-level="9.1.2" data-path="coding-style.html"><a href="coding-style.html#file-names"><i class="fa fa-check"></i><b>9.1.2</b> File names</a></li>
<li class="chapter" data-level="9.1.3" data-path="coding-style.html"><a href="coding-style.html#loading-packages"><i class="fa fa-check"></i><b>9.1.3</b> Loading packages</a></li>
<li class="chapter" data-level="9.1.4" data-path="coding-style.html"><a href="coding-style.html#commenting"><i class="fa fa-check"></i><b>9.1.4</b> Commenting</a></li>
<li class="chapter" data-level="9.1.5" data-path="coding-style.html"><a href="coding-style.html#object-names"><i class="fa fa-check"></i><b>9.1.5</b> Object names</a></li>
<li class="chapter" data-level="9.1.6" data-path="coding-style.html"><a href="coding-style.html#example-package"><i class="fa fa-check"></i><b>9.1.6</b> Example package</a></li>
<li class="chapter" data-level="9.1.7" data-path="coding-style.html"><a href="coding-style.html#assignment"><i class="fa fa-check"></i><b>9.1.7</b> Assignment</a></li>
<li class="chapter" data-level="9.1.8" data-path="coding-style.html"><a href="coding-style.html#spacing"><i class="fa fa-check"></i><b>9.1.8</b> Spacing</a></li>
<li class="chapter" data-level="9.1.9" data-path="coding-style.html"><a href="coding-style.html#indentation"><i class="fa fa-check"></i><b>9.1.9</b> Indentation</a></li>
<li class="chapter" data-level="9.1.10" data-path="coding-style.html"><a href="coding-style.html#curly-braces"><i class="fa fa-check"></i><b>9.1.10</b> Curly braces</a></li>
<li class="chapter" data-level="9.1.11" data-path="coding-style.html"><a href="coding-style.html#exercises-17"><i class="fa fa-check"></i><b>9.1.11</b> Exercises</a></li>
</ul></li>
</ul></li>
<li class="chapter" data-level="10" data-path="efficient-learning.html"><a href="efficient-learning.html"><i class="fa fa-check"></i><b>10</b> Efficient Learning</a><ul>
<li class="chapter" data-level="10.1" data-path="using-r-help.html"><a href="using-r-help.html"><i class="fa fa-check"></i><b>10.1</b> Using R Help</a></li>
<li class="chapter" data-level="10.2" data-path="reading-r-source-code.html"><a href="reading-r-source-code.html"><i class="fa fa-check"></i><b>10.2</b> Reading R source code</a></li>
<li class="chapter" data-level="10.3" data-path="learning-online.html"><a href="learning-online.html"><i class="fa fa-check"></i><b>10.3</b> Learning online</a><ul>
<li class="chapter" data-level="10.3.1" data-path="learning-online.html"><a href="learning-online.html#reproducible-example"><i class="fa fa-check"></i><b>10.3.1</b> Reproducible example</a></li>
<li class="chapter" data-level="10.3.2" data-path="learning-online.html"><a href="learning-online.html#minimal-data-set"><i class="fa fa-check"></i><b>10.3.2</b> Minimal data set</a></li>
<li class="chapter" data-level="10.3.3" data-path="learning-online.html"><a href="learning-online.html#minimal-example"><i class="fa fa-check"></i><b>10.3.3</b> Minimal example</a></li>
</ul></li>
<li class="chapter" data-level="10.4" data-path="online-resources.html"><a href="online-resources.html"><i class="fa fa-check"></i><b>10.4</b> Online resources</a><ul>
<li class="chapter" data-level="10.4.1" data-path="online-resources.html"><a href="online-resources.html#stackoverflow"><i class="fa fa-check"></i><b>10.4.1</b> Stackoverflow</a></li>
<li class="chapter" data-level="10.4.2" data-path="online-resources.html"><a href="online-resources.html#mailing-lists-help-dev-package"><i class="fa fa-check"></i><b>10.4.2</b> Mailing lists: help, dev, package</a></li>
<li class="chapter" data-level="10.4.3" data-path="online-resources.html"><a href="online-resources.html#r-bloggers"><i class="fa fa-check"></i><b>10.4.3</b> r-bloggers</a></li>
<li class="chapter" data-level="10.4.4" data-path="online-resources.html"><a href="online-resources.html#twitter-rstats"><i class="fa fa-check"></i><b>10.4.4</b> twitter: <code>#rstats</code></a></li>
</ul></li>
<li class="chapter" data-level="10.5" data-path="conferences.html"><a href="conferences.html"><i class="fa fa-check"></i><b>10.5</b> Conferences</a><ul>
<li class="chapter" data-level="10.5.1" data-path="conferences.html"><a href="conferences.html#user"><i class="fa fa-check"></i><b>10.5.1</b> useR!</a></li>
<li class="chapter" data-level="10.5.2" data-path="conferences.html"><a href="conferences.html#local-groups"><i class="fa fa-check"></i><b>10.5.2</b> Local groups</a></li>
</ul></li>
<li class="chapter" data-level="10.6" data-path="code.html"><a href="code.html"><i class="fa fa-check"></i><b>10.6</b> Code</a></li>
<li class="chapter" data-level="10.7" data-path="look-at-the-source-code.html"><a href="look-at-the-source-code.html"><i class="fa fa-check"></i><b>10.7</b> Look at the source code</a><ul>
<li class="chapter" data-level="10.7.1" data-path="look-at-the-source-code.html"><a href="look-at-the-source-code.html#r-journal-and-journal-of-statistical-software"><i class="fa fa-check"></i><b>10.7.1</b> R-journal and Journal of Statistical Software</a></li>
</ul></li>
</ul></li>
<li class="divider"></li>
<li><a href="http://www.mas.ncl.ac.uk/~ncsg3/">Colin Gillespie</a>, Robin Lovelace</li>
</ul>
</nav>
</div>
<div class="book-body">
<div class="body-inner">
<div class="book-header" role="navigation">
<h1>
<i class="fa fa-circle-o-notch fa-spin"></i><a href="./">Efficient R programming</a>
</h1>
</div>
<div class="page-wrapper" tabindex="-1" role="main">
<div class="page-inner">
<section class="normal" id="section-">
<div id="look-at-the-source-code" class="section level2">
<h2><span class="header-section-number">10.7</span> Look at the source code</h2>
<pre><code>* e.g. `NCOL`
* Learn from well known packages
* git version of R
* Monitor changes in the NEWS</code></pre>
<div id="r-journal-and-journal-of-statistical-software" class="section level3">
<h3><span class="header-section-number">10.7.1</span> R-journal and Journal of Statistical Software</h3>
<div id="refs" class="references">
<div>
<p>Berkun, Scott. 2005. <em>The Art of Project Management</em>. O’Reilly.</p>
</div>
<div>
<p>Braun, John, and Duncan J Murdoch. 2007. <em>A First Course in Statistical Programming with R</em>. Vol. 25. Cambridge University Press Cambridge.</p>
</div>
<div>
<p>Burns, Patrick. 2011. <em>The R Inferno</em>. Lulu.com.</p>
</div>
<div>
<p>Codd, E. F. 1979. “Extending the database relational model to capture more meaning.” <em>ACM Transactions on Database Systems</em> 4 (4): 397–434. doi:<a href="https://doi.org/10.1145/320107.320109">10.1145/320107.320109</a>.</p>
</div>
<div>
<p>Cotton, Richard. 2013. <em>Learning R</em>. “O’Reilly Media, Inc.”</p>
</div>
<div>
<p>Eddelbuettel, Dirk. 2010. “Benchmarking Single-and Multi-Core BLAS Implementations and GPUs for Use with R.” Mathematica.</p>
</div>
<div>
<p>———. 2013. <em>Seamless R and C++ Integration with Rcpp</em>. Springer.</p>
</div>
<div>
<p>Eddelbuettel, Dirk, and Romain François. 2011. “Rcpp: Seamless R and C++ Integration.” <em>Journal of Statistical Software</em> 40 (8): 1–18.</p>
</div>
<div>
<p>Eddelbuettel, Dirk, Romain François, J. Allaire, John Chambers, Douglas Bates, and Kevin Ushey. 2011. “Rcpp: Seamless R and C++ Integration.” <em>Journal of Statistical Software</em> 40 (8): 1–18.</p>
</div>
<div>
<p>Goldberg, David. 1991. “What Every Computer Scientist Should Know About Floating-Point Arithmetic.” <em>ACM Computing Surveys (CSUR)</em> 23 (1). ACM: 5–48.</p>
</div>
<div>
<p>Grolemund, Garrett, and Hadley Wickham. 2016. <em>R for Data Science</em>. 1 edition. O’Reilly Media.</p>
</div>
<div>
<p>Kersten, Martin L, Stratos Idreos, Stefan Manegold, Erietta Liarou, and others. 2011. “The Researcher’s Guide to the Data Deluge: Querying a Scientific Database in Just a Few Seconds.” <em>PVLDB Challenges and Visions</em> 3.</p>
</div>
<div>
<p>McCallum, Ethan, and Stephen Weston. 2011. <em>Parallel R</em>. “ O’Reilly Media, Inc.”</p>
</div>
<div>
<p>McConnell, Steve. 2004. <em>Code Complete</em>. Pearson Education.</p>
</div>
<div>
<p>PMBoK, A. 2000. “Guide to the Project Management Body of Knowledge.” <em>Project Management Institute, Pennsylvania USA</em>.</p>
</div>
<div>
<p>Sekhon, Jasjeet S. 2006. “The Art of Benchmarking: Evaluating the Performance of R on Linux and OS X.” <em>The Political Methodologist</em> 14 (1): 15–19.</p>
</div>
<div>
<p>Spector, Phil. 2008. <em>Data Manipulation with R</em>. Springer Science & Business Media.</p>
</div>
<div>
<p>Wickham, Hadley. 2014a. <em>Advanced R</em>. CRC Press.</p>
</div>
<div>
<p>———. 2014b. “Tidy Data.” <em>The Journal of Statistical Software</em> 14 (5).</p>
</div>
<div>
<p>———. 2015. <em>R Packages</em>. O’Reilly Media, Inc.</p>
</div>
<div>
<p>Xie, Yihui. 2015. <em>Dynamic Documents with R and Knitr</em>. Vol. 29. CRC Press.</p>
</div>
</div>
</div>
</div>
</div>
<!-- -->
</section>
</div>
</div>
</div>
<a href="code.html" class="navigation navigation-prev navigation-unique" aria-label="Previous page"><i class="fa fa-angle-left"></i></a>
<script src="libs/gitbook-2.6.7/js/app.min.js"></script>
<script src="libs/gitbook-2.6.7/js/lunr.js"></script>
<script src="libs/gitbook-2.6.7/js/plugin-search.js"></script>
<script src="libs/gitbook-2.6.7/js/plugin-sharing.js"></script>
<script src="libs/gitbook-2.6.7/js/plugin-fontsettings.js"></script>
<script src="libs/gitbook-2.6.7/js/plugin-bookdown.js"></script>
<script src="libs/gitbook-2.6.7/js/jquery.highlight.js"></script>
<script>
require(["gitbook"], function(gitbook) {
gitbook.start({
"sharing": {
"facebook": true,
"twitter": true,
"google": false,
"weibo": false,
"instapper": false,
"vk": false,
"all": ["facebook", "google", "twitter", "weibo", "instapaper"]
},
"fontsettings": {
"theme": "white",
"family": "sans",
"size": 2
},
"edit": {
"link": "https://github.com/csgillespie/efficientR/edit/master/10-learning.Rmd",
"text": "Edit"
},
"download": ["_main.pdf"],
"toc": {
"collapse": "subsection"
}
});
});
</script>
<!-- dynamically load mathjax for compatibility with self-contained -->
<script>
(function () {
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML";
if (location.protocol !== "file:" && /^https?:/.test(script.src))
script.src = script.src.replace(/^https?:/, '');
document.getElementsByTagName("head")[0].appendChild(script);
})();
</script>
</body>
</html>