Reproducible research with R and RStudio:
Gespeichert in:
1. Verfasser: | |
---|---|
Format: | Buch |
Sprache: | English |
Veröffentlicht: |
Boca Raton, Fla. [u.a.]
CRC Press
2015
|
Ausgabe: | 2. ed. |
Schriftenreihe: | The R series
|
Schlagworte: | |
Online-Zugang: | Inhaltsverzeichnis |
Beschreibung: | XXVII, 295 S. Ill., graph. Darst., Kt. |
ISBN: | 9781498715379 |
Internformat
MARC
LEADER | 00000nam a2200000 c 4500 | ||
---|---|---|---|
001 | BV042876722 | ||
003 | DE-604 | ||
005 | 20211118 | ||
007 | t | ||
008 | 150917s2015 abd| |||| 00||| eng d | ||
020 | |a 9781498715379 |c pbk |9 978-1-4987-1537-9 | ||
035 | |a (OCoLC)919678225 | ||
035 | |a (DE-599)BSZ443433968 | ||
040 | |a DE-604 |b ger | ||
041 | 0 | |a eng | |
049 | |a DE-473 |a DE-945 |a DE-573 |a DE-355 |a DE-19 |a DE-11 | ||
082 | 0 | |a 001.4/2202855133 | |
084 | |a CM 4400 |0 (DE-625)18955: |2 rvk | ||
084 | |a ST 250 |0 (DE-625)143626: |2 rvk | ||
084 | |a ST 601 |0 (DE-625)143682: |2 rvk | ||
100 | 1 | |a Gandrud, Christopher |e Verfasser |0 (DE-588)1044135131 |4 aut | |
245 | 1 | 0 | |a Reproducible research with R and RStudio |c Christopher Gandrud |
250 | |a 2. ed. | ||
264 | 1 | |a Boca Raton, Fla. [u.a.] |b CRC Press |c 2015 | |
300 | |a XXVII, 295 S. |b Ill., graph. Darst., Kt. | ||
336 | |b txt |2 rdacontent | ||
337 | |b n |2 rdamedia | ||
338 | |b nc |2 rdacarrier | ||
490 | 0 | |a The R series | |
650 | 0 | 7 | |a Quantitative Methode |0 (DE-588)4232139-6 |2 gnd |9 rswk-swf |
650 | 0 | 7 | |a Empirische Forschung |0 (DE-588)4300400-3 |2 gnd |9 rswk-swf |
650 | 0 | 7 | |a R |g Programm |0 (DE-588)4705956-4 |2 gnd |9 rswk-swf |
689 | 0 | 0 | |a Empirische Forschung |0 (DE-588)4300400-3 |D s |
689 | 0 | 1 | |a Quantitative Methode |0 (DE-588)4232139-6 |D s |
689 | 0 | 2 | |a R |g Programm |0 (DE-588)4705956-4 |D s |
689 | 0 | |5 DE-604 | |
856 | 4 | 2 | |m Digitalisierung UB Bamberg - ADAM Catalogue Enrichment |q application/pdf |u http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=028305720&sequence=000002&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA |3 Inhaltsverzeichnis |
999 | |a oai:aleph.bib-bvb.de:BVB01-028305720 |
Datensatz im Suchindex
_version_ | 1804175161222496256 |
---|---|
adam_text | Contents
Preface xiii
Stylistic Conventions xvii
Required R Packages xix
Additional Resources xxi
List of Figures
xxv
List of Tables
xxvii
I Getting Started
1
1 Introducing Reproducible Research
1.1 What Is Reproducible Research?............................
1.2 Why Should Research Be Reproducible? .....................
1.2.1 For science........................................
1.2.2 For you............................................
1.3 Who Should Read This Book? ...............................
1.3.1 Academic researchers...............................
1.3.2 Students...........................................
1.3.3 Instructors .......................................
1.3.4 Editors ...........................................
1.3.5 Private sector researchers.........................
1.4 The Tools of Reproducible Research........................
1.5 Why Use R. knitrf miarkdown, and RStudio for Reproducible
Research?.................................................
1.5.1 Installing the main software.......................
l.G Book Overview.............................................
1.6.1 How to read this book..............................
1.6.2 Reproduce this book................................
1.6.3 Contents overview..................................
3
3
6
8
8
8
8
9
9
10
11
13
14
16
16
17
vii
vin
2 Getting Started with Reproducible Research
2.1 The Big Picture: A Workflow for Reproducible Research . .
2.1.1 Reproducible theory................................
2.2 Practical Tips for Reproducible Research ................
2.2.1 Document everything!...............................
2.2.2 Everything is a (text) file........................
2.2.3 All files should be human readable.................
2.2.4 Explicitly tie your files together.................
2.2.5 Have a plan to organize, store, and make your files avail-
able .....................................................
19
19
20
22
22
24
24
26
27
3 Getting Started with R, RStudio, and knitr/rmarkdown
3.1 Using R: The Basics................................
3.1.1 Objects.....................................
3.1.2 Component selection.........................
3.1.3 Subscripts..................................
3.1.4 Functions and commands......................
3.1.5 Arguments ..................................
3.1.6 The workspace L· history ...................
3.1.7 Global R options............................
3.1.8 Installing new packages and loading functions . .
3.2 Using RStudio .....................................
3.3 Using k՝nit7՝ and rmarkdown: The Basics............
3.3.1 What knit.r dot s...........................
3.3.2 Wh at nnarkdoum does........................
3.3.3 File extensions.............................
3.3.4 Code chunks.................................
3.3.5 Global c hunk options.......................
3.3.6 kniti՝ package options......................
3.3.7 Hooks.......................................
3.3.8 kniti imaikdoum, RStudio...................
3.3.9 knitr՝ tsz R................................
3.3.10 nnarkdoum.and R ............................
29
29
30
36
38
39
40
42
44
44
45
47
48
48
50
50
53
55
55
56
59
61
4 Getting Started with File Management 65
4.1 File Paths Naming Conventions............................ 66
4.1.1 Root directories...................................... 66
4.1.2 Subdirectories L· parent directories.................. 66
4.1.3 Working directories................................... 67
4.1.4 Absolute vs. relative paths .......................... 67
4.1.5 Spaces in directory L· file names .................... 68
1.2 Organizing Your Research Project ......................... 69
4.3 Setting Directories as RStudio Projects .................. 70
4.4 R file Manipulation Commands........................ 70
ix
4.5 Unix-like Shell Commands for File Management ............ 74
4.6 File Navigation in RStudio .............................. 78
II Data Gathering and Storage 81
5 Storing, Collaborating, Accessing Files, and Versioning 83
5.1 Saving Data in Reproducible Formats ..................... 84
5.2 Storing Your Files in the Cloud: Dropbox................. 85
5.2.1 Storage.............................................. 86
5.2.2 Accessing data....................................... 86
5.2.3 Collaboration........................................ 88
5.2.4 Version control...................................... 88
5.3 Storing Your Files in the Cloud: Git Hub ................ 89
5.3.1 Setting up GitHub: Basic............................. 91
5.3.2 Version control with Git............................. 92
5.3.3 Remote storage on GitHub............................ 100
5.3.4 Accessing on GitHub................................. 102
5.3.4.1 Collaboration with GitHub................ 104
5.3.5 Summing up the GitHub workflow...................... 105
5.4 RStudio L· GitHub ....................................... 105
5.4.1 Setting up Git/GitHub with Projects ................ 105
5.4.2 Using Git in RStudio Projects ...................... 107
6 Gathering Data with R 109
6.1 Organize Your Data Gathering: Makefiles.................. 109
6.1.1 R Make-like files................................... 110
6.1.2 GNU Make............................................ Ill
6.1.2.1 Example makefile .......................... 112
6.1.2.2 Makefiles and RStudio Projects .......... 116
6.1.2.3 Other information about makefiles........ 116
6.2 Importing Locally Ston d Data Sets ...................... 117
6.3 Importing Data Sets from the Internet ................... 118
6.3.1 Data from non-seeuro (http) URLs.................... 118
6.3.2 Data from secure (https) URLs ...................... 119
6.3.3 Compressed data stored online....................... 121
6.3.4 Data APIs L feeds................................... 123
6.4 Advanced Automatic Data Gathering: Web Scraping.......... 125
7 Preparing Data for Analysis 129
7.1 Cleaning Data for Merging ............................... 129
7.1.1 Get a handle on your data........................... 129
7.1.2 Reshaping data...................................... 131
7.1.3 Renaming variables.................................. 134
7.1.4 Ordering data....................................... 134
7.1.5 Subsetting data..............
7.1.6 Recoding string/numeric variables
7.1.7 Creating new variables from old
7.1.8 Changing variable types......
7.2 Merging Data Sets...................
7.2.1 Binding......................
7.2.2 The merge command............
7.2.3 Duplicate values.............
7.2.4 Duplicate columns............
Ill Analysis and Results
135
137
139
142
143
143
143
146
147
151
8 Statistical Modeling and knitr
8.1 Incorporating Analyses into the Markup ................
8.1.1 Full code chunks.................................
8.1.2 Showing code results inline....................
8.1.2.1 LaTeX ..................................
8.1.2.2 Markdown ...............................
8.1.3 Dynamically including non-R code in code chunks .
8.2 Dynamically Including Modular Analysis Files...........
8.2.1 Source from a local file.........................
8.2.2 Source՝ from a non-secure URL (http).............
8.2.3 Source from a secure URL (https).................
8.3 Reproducibly Random: set. seed ........................
8.4 Computationally Intensive Analyses ....................
153
154
154
156
156
158
159
159
160
162
162
163
164
9 Showing Results with Tables
9.1 Basic knitr Syntax for Tables.......................
9.2 Table Basics ........................................ 168
9.2.1 Tables in LaTeX................................ 169
9.2.2 Tables in Markdown/HTML ...................... 173
9.3 Creating Tables from Supported Class R Objects....... 177
9.3.1 kable for Markdown and LaTeX................... 177
9.3.2 xtable for LaTeX and HTML...................... 178
9.3.3 tcxreg for LaTeX and HTML...................... 181
9.3.4 Fitting Large Tables in LaTeX................. 184
9.3.5 xtable with non-supported class objects........ 185
9.3.6 Creating variable description documents with xtable . 188
10 Showing Results with Figures 191
10.1 Including Xon-kmttcd Graphics ....................... 191
10.LI Including graphics in LaTeX................... 192
10.1.2 Including graphics in Markdown/HTML.......... 194
10.2 Basic knitrf nnorkdown Figure Options .............. 195
xi
10.2.1 Chunk options.................................... 195
10.2.2 Global options................................... 196
10.3 Knitting TVs Default Graphics .......................... 197
10.4 Including ggplot2 Graphics.................................. 200
10.4.1 Showing regression results with caterpillar plots .... 204
10.5 JavaScript Graphs with googleVis .......................... 209
10.5.1 JavaScript Graphs with htmlwidgets-based packages . 212
IV Presentation Documents 213
11 Presenting with knitr/LaTeX 215
11.1 The Basics ................................................. 215
11.1.1 Getting started with LaTeX editors ................... 216
11.1.2 Basic LaTeX command syntax ........................... 216
11.1.3 The LaTeX preamble body............................. 217
11.1.4 Headings ......................................... 220
11.1.5 Paragraphs spacing.................................. 221
11.1.6 Horizontal lines...................................... 221
11.1.7 Text formatting....................................... 221
11.1.8 Math ................................................. 223
11.1.9 Lists............................................ 224
11.1.10 Footnotes....................................... 225
11.1.11 Cross֊ references............................... 225
11.2 Bibliographies with BibTeX ................................. 225
11.2.1 The Mb file........................................... 225
11.2.2 Including citations in LaTeX documents................ 227
11.2.3 Generating a BibTeX file of It package citations . . . 227
11.3 Presentations with LaTeX Beamer............................. 230
11.3.1 Beamer basics ........................................ 231
11.3.2 knitr with LaTeX slideshows .......................... 234
12 Large Ibmtr/LaTeX Documents: Theses, Books, and
Batch Reports 237
12.1 Planning Large Documents.................................... 237
12.2 Large Documents with Traditional LaTeX ................. 238
12.2.1 Inputting/inclufiing children ........................ 239
12.2.2 Other common features of large documents.............. 240
12.3 knitr and Large Documents................................... 241
12.3.1 The parent document .................................. 241
12.3.2 Knitting child documents.............................. 242
12.4 Child Doc uments in a Different Markup Language......... 243
12.5 Creating Batch Reports...................................... 244
XII
13 Presenting on the Web and Other Formats with
R Markdown 249
13.1 The Basics ............................................... 249
13.1.1 Getting started with Markdown editors............... 250
13.1.2 Preamble and document structure..................... 250
13.1.3 Headings ........................................... 252
13.1.4 Horizontal lines.................................... 253
13.1.5 Paragraphs and new lines........................... 253
13.1.6 Italics and bold.................................... 254
13.1.7 Links .............................................. 254
13.1.8 Special characters and font customization........... 254
13.1.9 Lists............................................... 254
13. L 10 Escape characters ................................ 255
13.1.11 Math with MathJax.................................. 255
13.2 Further Customizability with rmarkdown.................... 256
13.2.1 More on I rnarkdown Headers......................... 256
13.2.2 CSS style files and Markdown........................ 260
13.3 Slideshows with Markdown, rmarkdown, and HTML........... 261
13.3.1 HTML Slideshows with rmarkdown...................... 262
13.3.2 LaTeX Beanun* Slideshows with rmarkdown............. 264
13.3.3 Slideshows with Markdown and RStudio’s
R Presentations..................................... 265
13.1 Publishing HTML Documents Created by R Markdown . . . 268
13.1.1 Standalone HTML files .............................. 268
13.4.2 Hosting webpages with Dropbox....................... 268
13.4.3 Git Hub Pages....................................... 269
13.4.4 Further information on R Markdown................... 270
14 Conclusion 271
14.1 Citing Reproducible Research ........................... 271
14.2 Licensing Your Reproducible Research...................... 273
14.3 Sharing Your Code in Packages ............................ 273
14.4 Project Development: Public or Private? .................. 274
14. ) Is it Possible to Completely Future-Proof Your Research? . . 275
Bibliography 277
Index
285
|
any_adam_object | 1 |
author | Gandrud, Christopher |
author_GND | (DE-588)1044135131 |
author_facet | Gandrud, Christopher |
author_role | aut |
author_sort | Gandrud, Christopher |
author_variant | c g cg |
building | Verbundindex |
bvnumber | BV042876722 |
classification_rvk | CM 4400 ST 250 ST 601 |
ctrlnum | (OCoLC)919678225 (DE-599)BSZ443433968 |
dewey-full | 001.4/2202855133 |
dewey-hundreds | 000 - Computer science, information, general works |
dewey-ones | 001 - Knowledge |
dewey-raw | 001.4/2202855133 |
dewey-search | 001.4/2202855133 |
dewey-sort | 11.4 102202855133 |
dewey-tens | 000 - Computer science, information, general works |
discipline | Allgemeines Informatik Psychologie |
edition | 2. ed. |
format | Book |
fullrecord | <?xml version="1.0" encoding="UTF-8"?><collection xmlns="http://www.loc.gov/MARC21/slim"><record><leader>01706nam a2200421 c 4500</leader><controlfield tag="001">BV042876722</controlfield><controlfield tag="003">DE-604</controlfield><controlfield tag="005">20211118 </controlfield><controlfield tag="007">t</controlfield><controlfield tag="008">150917s2015 abd| |||| 00||| eng d</controlfield><datafield tag="020" ind1=" " ind2=" "><subfield code="a">9781498715379</subfield><subfield code="c">pbk</subfield><subfield code="9">978-1-4987-1537-9</subfield></datafield><datafield tag="035" ind1=" " ind2=" "><subfield code="a">(OCoLC)919678225</subfield></datafield><datafield tag="035" ind1=" " ind2=" "><subfield code="a">(DE-599)BSZ443433968</subfield></datafield><datafield tag="040" ind1=" " ind2=" "><subfield code="a">DE-604</subfield><subfield code="b">ger</subfield></datafield><datafield tag="041" ind1="0" ind2=" "><subfield code="a">eng</subfield></datafield><datafield tag="049" ind1=" " ind2=" "><subfield code="a">DE-473</subfield><subfield code="a">DE-945</subfield><subfield code="a">DE-573</subfield><subfield code="a">DE-355</subfield><subfield code="a">DE-19</subfield><subfield code="a">DE-11</subfield></datafield><datafield tag="082" ind1="0" ind2=" "><subfield code="a">001.4/2202855133</subfield></datafield><datafield tag="084" ind1=" " ind2=" "><subfield code="a">CM 4400</subfield><subfield code="0">(DE-625)18955:</subfield><subfield code="2">rvk</subfield></datafield><datafield tag="084" ind1=" " ind2=" "><subfield code="a">ST 250</subfield><subfield code="0">(DE-625)143626:</subfield><subfield code="2">rvk</subfield></datafield><datafield tag="084" ind1=" " ind2=" "><subfield code="a">ST 601</subfield><subfield code="0">(DE-625)143682:</subfield><subfield code="2">rvk</subfield></datafield><datafield tag="100" ind1="1" ind2=" "><subfield code="a">Gandrud, Christopher</subfield><subfield code="e">Verfasser</subfield><subfield code="0">(DE-588)1044135131</subfield><subfield code="4">aut</subfield></datafield><datafield tag="245" ind1="1" ind2="0"><subfield code="a">Reproducible research with R and RStudio</subfield><subfield code="c">Christopher Gandrud</subfield></datafield><datafield tag="250" ind1=" " ind2=" "><subfield code="a">2. ed.</subfield></datafield><datafield tag="264" ind1=" " ind2="1"><subfield code="a">Boca Raton, Fla. [u.a.]</subfield><subfield code="b">CRC Press</subfield><subfield code="c">2015</subfield></datafield><datafield tag="300" ind1=" " ind2=" "><subfield code="a">XXVII, 295 S.</subfield><subfield code="b">Ill., graph. Darst., Kt.</subfield></datafield><datafield tag="336" ind1=" " ind2=" "><subfield code="b">txt</subfield><subfield code="2">rdacontent</subfield></datafield><datafield tag="337" ind1=" " ind2=" "><subfield code="b">n</subfield><subfield code="2">rdamedia</subfield></datafield><datafield tag="338" ind1=" " ind2=" "><subfield code="b">nc</subfield><subfield code="2">rdacarrier</subfield></datafield><datafield tag="490" ind1="0" ind2=" "><subfield code="a">The R series</subfield></datafield><datafield tag="650" ind1="0" ind2="7"><subfield code="a">Quantitative Methode</subfield><subfield code="0">(DE-588)4232139-6</subfield><subfield code="2">gnd</subfield><subfield code="9">rswk-swf</subfield></datafield><datafield tag="650" ind1="0" ind2="7"><subfield code="a">Empirische Forschung</subfield><subfield code="0">(DE-588)4300400-3</subfield><subfield code="2">gnd</subfield><subfield code="9">rswk-swf</subfield></datafield><datafield tag="650" ind1="0" ind2="7"><subfield code="a">R</subfield><subfield code="g">Programm</subfield><subfield code="0">(DE-588)4705956-4</subfield><subfield code="2">gnd</subfield><subfield code="9">rswk-swf</subfield></datafield><datafield tag="689" ind1="0" ind2="0"><subfield code="a">Empirische Forschung</subfield><subfield code="0">(DE-588)4300400-3</subfield><subfield code="D">s</subfield></datafield><datafield tag="689" ind1="0" ind2="1"><subfield code="a">Quantitative Methode</subfield><subfield code="0">(DE-588)4232139-6</subfield><subfield code="D">s</subfield></datafield><datafield tag="689" ind1="0" ind2="2"><subfield code="a">R</subfield><subfield code="g">Programm</subfield><subfield code="0">(DE-588)4705956-4</subfield><subfield code="D">s</subfield></datafield><datafield tag="689" ind1="0" ind2=" "><subfield code="5">DE-604</subfield></datafield><datafield tag="856" ind1="4" ind2="2"><subfield code="m">Digitalisierung UB Bamberg - ADAM Catalogue Enrichment</subfield><subfield code="q">application/pdf</subfield><subfield code="u">http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=028305720&sequence=000002&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA</subfield><subfield code="3">Inhaltsverzeichnis</subfield></datafield><datafield tag="999" ind1=" " ind2=" "><subfield code="a">oai:aleph.bib-bvb.de:BVB01-028305720</subfield></datafield></record></collection> |
id | DE-604.BV042876722 |
illustrated | Illustrated |
indexdate | 2024-07-10T07:11:53Z |
institution | BVB |
isbn | 9781498715379 |
language | English |
oai_aleph_id | oai:aleph.bib-bvb.de:BVB01-028305720 |
oclc_num | 919678225 |
open_access_boolean | |
owner | DE-473 DE-BY-UBG DE-945 DE-573 DE-355 DE-BY-UBR DE-19 DE-BY-UBM DE-11 |
owner_facet | DE-473 DE-BY-UBG DE-945 DE-573 DE-355 DE-BY-UBR DE-19 DE-BY-UBM DE-11 |
physical | XXVII, 295 S. Ill., graph. Darst., Kt. |
publishDate | 2015 |
publishDateSearch | 2015 |
publishDateSort | 2015 |
publisher | CRC Press |
record_format | marc |
series2 | The R series |
spelling | Gandrud, Christopher Verfasser (DE-588)1044135131 aut Reproducible research with R and RStudio Christopher Gandrud 2. ed. Boca Raton, Fla. [u.a.] CRC Press 2015 XXVII, 295 S. Ill., graph. Darst., Kt. txt rdacontent n rdamedia nc rdacarrier The R series Quantitative Methode (DE-588)4232139-6 gnd rswk-swf Empirische Forschung (DE-588)4300400-3 gnd rswk-swf R Programm (DE-588)4705956-4 gnd rswk-swf Empirische Forschung (DE-588)4300400-3 s Quantitative Methode (DE-588)4232139-6 s R Programm (DE-588)4705956-4 s DE-604 Digitalisierung UB Bamberg - ADAM Catalogue Enrichment application/pdf http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=028305720&sequence=000002&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA Inhaltsverzeichnis |
spellingShingle | Gandrud, Christopher Reproducible research with R and RStudio Quantitative Methode (DE-588)4232139-6 gnd Empirische Forschung (DE-588)4300400-3 gnd R Programm (DE-588)4705956-4 gnd |
subject_GND | (DE-588)4232139-6 (DE-588)4300400-3 (DE-588)4705956-4 |
title | Reproducible research with R and RStudio |
title_auth | Reproducible research with R and RStudio |
title_exact_search | Reproducible research with R and RStudio |
title_full | Reproducible research with R and RStudio Christopher Gandrud |
title_fullStr | Reproducible research with R and RStudio Christopher Gandrud |
title_full_unstemmed | Reproducible research with R and RStudio Christopher Gandrud |
title_short | Reproducible research with R and RStudio |
title_sort | reproducible research with r and rstudio |
topic | Quantitative Methode (DE-588)4232139-6 gnd Empirische Forschung (DE-588)4300400-3 gnd R Programm (DE-588)4705956-4 gnd |
topic_facet | Quantitative Methode Empirische Forschung R Programm |
url | http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=028305720&sequence=000002&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA |
work_keys_str_mv | AT gandrudchristopher reproducibleresearchwithrandrstudio |