Muutke küpsiste eelistusi

Reproducible Research with R and R Studio 2nd New edition [Pehme köide]

  • Formaat: Paperback / softback, 323 pages, kõrgus x laius: 235x156 mm, kaal: 600 g, 16 Tables, black and white; 31 Illustrations, black and white
  • Sari: Chapman & Hall/CRC: The R Series
  • Ilmumisaeg: 02-Oct-2017
  • Kirjastus: CRC Press
  • ISBN-10: 1138469645
  • ISBN-13: 9781138469648
Teised raamatud teemal:
  • Pehme köide
  • Hind: 226,00 €*
  • * saadame teile pakkumise kasutatud raamatule, mille hind võib erineda kodulehel olevast hinnast
  • See raamat on trükist otsas, kuid me saadame teile pakkumise kasutatud raamatule.
  • Kogus:
  • Lisa ostukorvi
  • Tasuta tarne
  • Lisa soovinimekirja
  • Formaat: Paperback / softback, 323 pages, kõrgus x laius: 235x156 mm, kaal: 600 g, 16 Tables, black and white; 31 Illustrations, black and white
  • Sari: Chapman & Hall/CRC: The R Series
  • Ilmumisaeg: 02-Oct-2017
  • Kirjastus: CRC Press
  • ISBN-10: 1138469645
  • ISBN-13: 9781138469648
Teised raamatud teemal:
All the Tools for Gathering and Analyzing Data and Presenting Results



Reproducible Research with R and RStudio, Second Edition brings together the skills and tools needed for doing and presenting computational research. Using straightforward examples, the book takes you through an entire reproducible research workflow. This practical workflow enables you to gather and analyze data as well as dynamically present results in print and on the web.



New to the Second Edition















The rmarkdown package that allows you to create reproducible research documents in PDF, HTML, and Microsoft Word formats using the simple and intuitive Markdown syntax Improvements to RStudios interface and capabilities, such as its new tools for handling R Markdown documents Expanded knitr R code chunk capabilities The kable function in the knitr package and the texreg package for dynamically creating tables to present your data and statistical results An improved discussion of file organization, enabling you to take full advantage of relative file paths so that your documents are more easily reproducible across computers and systems The dplyr, magrittr, and tidyr packages for fast data manipulation Numerous modifications to R syntax in user-created packages Changes to GitHubs and Dropboxs interfaces









Create Dynamic and Highly Reproducible Research



This updated book provides all the tools to combine your research with the presentation of your findings. It saves you time searching for information so that you can spend more time actually addressing your research questions. Supplementary files used for the examples and a reproducible research project are available on the authors website.

Arvustused

"The first edition of Reproducible Research with R and RStudio was an invaluable companion in the early stages of my journey, and I trust that the second edition will be equally useful to aspiring data analysts." MAA Reviews, July 2015



Praise for the First Edition: " a very practical book that teaches good practice in organizing reproducible data analysis and comes with a series of examples. an extremely valuable overview of the current capabilities of R, RStudio, and related software tools for reproducible research. I recommend this book to anyone who wants to learn more about these fascinating tools." Biometrical Journal, 2014



"Gandrud has written a great outline of how a fully reproducible research project should look from start to finish, with brief explanations of each tool that he uses along the way. the readers who will get the most use from this book are those already working in R and just need a way to organize their work. That being said, advanced undergraduate students in mathematics, statistics, and similar fields as well as students just beginning their graduate studies would benefit the most from reading this book. Many more experienced R users or second-year graduate students might find themselves thinking, I wish Id read this book at the start of my studies, when I was first learning R! a good text for beginning graduate students or advanced undergraduate students who are just starting to do technical research. This book could be used as the main text for a class on reproducible research " The American Statistician, November 2014









"Three recent books have significantly influenced how I use R in reproducible work: Dynamic Documents with R and knitr by Yihui Xie, Reproducible Research with R and RStudio by Christopher Gandrud, and Implementing Reproducible Research edited by Victoria Stodden, Friedrich Leisch, and Roger D. Peng I recommend all three books to R users at any level. There really is something here for everyone." Richard Layton, PhD, PE, Rose-Hulman Institute of Technology, Terre Haute, Indiana, USA

Preface xiii
Stylistic Conventions xvii
Required R Packages xix
Additional Resources xxi
List of Figures xxv
List of Tables xxvii
I Getting Started 1(80)
1 Introducing Reproducible Research
3(16)
1.1 What Is Reproducible Research?
3(2)
1.2 Why Should Research Be Reproducible?
5(3)
1.2.1 For science
5(1)
1.2.2 For you
6(2)
1.3 Who Should Read This Book?
8(2)
1.3.1 Academic researchers
8(1)
1.3.2 Students
8(1)
1.3.3 Instructors
8(1)
1.3.4 Editors
9(1)
1.3.5 Private sector researchers
9(1)
1.4 The Tools of Reproducible Research
10(1)
1.5 Why Use R, knitr/rmarkdown, and RStudio for Reproducible Research?
11(3)
1.5.1 Installing the main software
13(1)
1.6 Book Overview
14(5)
1.6.1 How to read this book
16(1)
1.6.2 Reproduce this book
16(1)
1.6.3 Contents overview
17(2)
2 Getting Started with Reproducible Research
19(10)
2.1 The Big Picture: A Workflow for Reproducible Research
19(3)
2.1.1 Reproducible theory
20(2)
2.2 Practical Tips for Reproducible Research
22(7)
2.2.1 Document everything!
22(2)
2.2.2 Everything is a (text) file
24(1)
2.2.3 All files should be human readable
24(2)
2.2.4 Explicitly tie your files together
26(1)
2.2.5 Have a plan to organize, store, and make your files available
27(2)
3 Getting Started with R, RStudio, and knitr/rmarkdown
29(36)
3.1 Using R: The Basics
29(16)
3.1.1 Objects
30(6)
3.1.2 Component selection
36(2)
3.1.3 Subscripts
38(1)
3.1.4 Functions and commands
39(1)
3.1.5 Arguments
40(2)
3.1.6 The workspace & history
42(2)
3.1.7 Global R options
44(1)
3.1.8 Installing new packages and loading functions
44(1)
3.2 Using RStudio
45(2)
3.3 Using knitr and rmarkdown: The Basics
47(18)
3.3.1 What knitr does
48(1)
3.3.2 What rmarkdown does
48(2)
3.3.3 File extensions
50(1)
3.3.4 Code chunks
50(3)
3.3.5 Global chunk options
53(2)
3.3.6 knitr package options
55(1)
3.3.7 Hooks
55(1)
3.3.8 knitr, rmarkdown, & RStudio
56(3)
3.3.9 knitr & R
59(2)
3.3.10 rmarkdown and R
61(4)
4 Getting Started with File Management
65(16)
4.1 File Paths & Naming Conventions
66(3)
4.1.1 Root directories
66(1)
4.1.2 Subdirectories & parent directories
66(1)
4.1.3 Working directories
67(1)
4.1.4 Absolute vs. relative paths
67(1)
4.1.5 Spaces in directory & file names
68(1)
4.2 Organizing Your Research Project
69(1)
4.3 Setting Directories as RStudio Projects
70(1)
4.4 R File Manipulation Commands
70(4)
4.5 Unix-like Shell Commands for File Management
74(4)
4.6 File Navigation in RStudio
78(3)
II Data Gathering and Storage 81(70)
5 Storing, Collaborating, Accessing Files, and Versioning
83(26)
5.1 Saving Data in Reproducible Formats
84(1)
5.2 Storing Your Files in the Cloud: Dropbox
85(4)
5.2.1 Storage
86(1)
5.2.2 Accessing data
86(2)
5.2.3 Collaboration
88(1)
5.2.4 Version control
88(1)
5.3 Storing Your Files in the Cloud: GitHub
89(16)
5.3.1 Setting up GitHub: Basic
91(1)
5.3.2 Version control with Git
92(8)
5.3.3 Remote storage on GitHub
100(2)
5.3.4 Accessing on GitHub
102(3)
5.3.4.1 Collaboration with GitHub
104(1)
5.3.5 Summing up the GitHub workflow
105(1)
5.4 RStudio & GitHub
105(4)
5.4.1 Setting up Git/GitHub with Projects
105(2)
5.4.2 Using Git in RStudio Projects
107(2)
6 Gathering Data with R
109(20)
6.1 Organize Your Data Gathering: Makefiles
109(8)
6.1.1 R Make-like files
110(1)
6.1.2 GNU Make
111(7)
6.1.2.1 Example makefile
112(4)
6.1.2.2 Makefiles and RStudio Projects
116(1)
6.1.2.3 Other information about makefiles
116(1)
6.2 Importing Locally Stored Data Sets
117(1)
6.3 Importing Data Sets from the Internet
118(7)
6.3.1 Data from non-secure (http) URLs
118(1)
6.3.2 Data from secure (https) URLs
119(2)
6.3.3 Compressed data stored online
121(2)
6.3.4 Data APIs & feeds
123(2)
6.4 Advanced Automatic Data Gathering: Web Scraping
125(4)
7 Preparing Data for Analysis
129(22)
7.1 Cleaning Data for Merging
129(14)
7.1.1 Get a handle on your data
129(2)
7.1.2 Reshaping data
131(3)
7.1.3 Renaming variables
134(1)
7.1.4 Ordering data
134(1)
7.1.5 Subsetting data
135(2)
7.1.6 Recoding string/numeric variables
137(2)
7.1.7 Creating new variables from old
139(3)
7.1.8 Changing variable types
142(1)
7.2 Merging Data Sets
143(10)
7.2.1 Binding
143(1)
7.2.2 The merge command
143(3)
7.2.3 Duplicate values
146(1)
7.2.4 Duplicate columns
147(4)
III Analysis and Results 151(62)
8 Statistical Modeling and knitr
153(14)
8.1 Incorporating Analyses into the Markup
154(5)
8.1.1 Full code chunks
154(2)
8.1.2 Showing code & results inline
156(3)
8.1.2.1 LaTeX
156(2)
8.1.2.2 Markdown
158(1)
8.1.3 Dynamically including non-R code in code chunks
159(1)
8.2 Dynamically Including Modular Analysis Files
159(4)
8.2.1 Source from a local file
160(2)
8.2.2 Source from a non-secure URL (http)
162(1)
8.2.3 Source from a secure URL (https)
162(1)
8.3 Reproducibly Random: set . seed
163(1)
8.4 Computationally Intensive Analyses
164(3)
9 Showing Results with Tables
167(24)
9.1 Basic knitr Syntax for Tables
168(1)
9.2 Table Basics
168(9)
9.2.1 Tables in LaTeX
169(4)
9.2.2 Tables in Markdown/HTML
173(4)
9.3 Creating Tables from Supported Class R Objects
177(14)
9.3.1 kable for Markdown and LaTeX
177(1)
9.3.2 xtable for LaTeX and HTML
178(3)
9.3.3 texreg for LaTeX and HTML
181(3)
9.3.4 Fitting Large Tables in LaTeX
184(1)
9.3.5 xtable with non-supported class objects
185(3)
9.3.6 Creating variable description documents with xtable
188(3)
10 Showing Results with Figures
191(22)
10.1 Including Non-knitted Graphics
191(4)
10.1.1 Including graphics in LaTeX
192(2)
10.1.2 Including graphics in Markdown/HTML
194(1)
10.2 Basic knitr/rmarkdown Figure Options
195(2)
10.2.1 Chunk options
195(1)
10.2.2 Global options
196(1)
10.3 Knitting R's Default Graphics
197(3)
10.4 Including ggplot2 Graphics
200(9)
10.4.1 Showing regression results with caterpillar plots
204(5)
10.5 JavaScript Graphs with googleVis
209(6)
10.5.1 JavaScript Graphs with htmlwidgets-based packages
212(1)
IV Presentation Documents 213(64)
11 Presenting with knitr/LaTeX
215(22)
11.1 The Basics
215(10)
11.1.1 Getting started with LaTeX editors
216(1)
11.1.2 Basic LaTeX command syntax
216(1)
11.1.3 The LaTeX preamble & body
217(3)
11.1.4 Headings
220(1)
11.1.5 Paragraphs & spacing
221(1)
11.1.6 Horizontal lines
221(1)
11.1.7 Text formatting
221(2)
11.1.8 Math
223(1)
11.1.9 Lists
224(1)
11.1.10 Footnotes
225(1)
11.1.11 Cross-references
225(1)
11.2 Bibliographies with BibTeX
225(5)
11.2.1 The . bib file
225(2)
11.2.2 Including citations in LaTeX documents
227(1)
11.2.3 Generating a BibTeX file of R package citations
227(3)
11.3 Presentations with LaTeX Beamer
230(7)
11.3.1 Beamer basics
231(3)
11.3.2 knitr with LaTeX slideshows
234(3)
12 Large knitr/LaTeX Documents: Theses, Books, and Batch Reports
237(12)
12.1 Planning Large Documents
237(1)
12.2 Large Documents with Traditional LaTeX
238(3)
12.2.1 Inputting/including children
239(1)
12.2.2 Other common features of large documents
240(1)
12.3 knitr and Large Documents
241(2)
12.3.1 The parent document
241(1)
12.3.2 Knitting child documents
242(1)
12.4 Child Documents in a Different Markup Language
243(1)
12.5 Creating Batch Reports
244(5)
13 Presenting on the Web and Other Formats with R Markdown
249(22)
13.1 The Basics
249(7)
13.1.1 Getting started with Markdown editors
250(1)
13.1.2 Preamble and document structure
250(2)
13.1.3 Headings
252(1)
13.1.4 Horizontal lines
253(1)
13.1.5 Paragraphs and new lines
253(1)
13.1.6 Italics and bold
254(1)
13.1.7 Links
254(1)
13.1.8 Special characters and font customization
254(1)
13.1.9 Lists
254(1)
13.1.10 Escape characters
255(1)
13.1.11 Math with MathJax
255(1)
13.2 Further Customizability with rmarkdown
256(5)
13.2.1 More on rmarkdown Headers
256(4)
13.2.2 CSS style files and Markdown
260(1)
13.3 Slideshows with Markdown, rmarkdown, and HTML
261(7)
13.3.1 HTML Slideshows with rmarkdown
262(2)
13.3.2 LaTeX Beamer Slideshows with rmarkdown
264(1)
13.3.3 Slideshows with Markdown and RStudio's R Presentations
265(3)
13.4 Publishing HTML Documents Created by R Markdown
268(3)
13.4.1 Standalone HTML files
268(1)
13.4.2 Hosting webpages with Dropbox
268(1)
13.4.3 GitHub Pages
269(1)
13.4.4 Further information on R Markdown
270(1)
14 Conclusion
271(6)
14.1 Citing Reproducible Research
271(2)
14.2 Licensing Your Reproducible Research
273(1)
14.3 Sharing Your Code in Packages
273(1)
14.4 Project Development: Public or Private?
274(1)
14.5 Is it Possible to Completely Future-Proof Your Research?
275(2)
Bibliography 277(8)
Index 285
Christopher Gandrud is a postdoctoral researcher in the Fiscal Governance Centre at the Hertie School of Governance. His research focuses on the international political economy of public financial and monetary institutions as well as applied social science statistics and software development. He has published many articles in peer-reviewed journals, including the Journal of Common Market Studies, Review of International Political Economy, Political Science Research and Methods, Journal of Statistical Software, and International Political Science Review. He earned a PhD in quantitative political science from the London School of Economics.