
Efficient R Programming
Description
Alles über E-Books | Antworten auf Fragen rund um E-Books, Kopierschutz und Dateiformate finden Sie in unserem Info- & Hilfebereich.
More details
Other editions
Additional editions

Content
- Intro
- Copyright
- Table of Contents
- Preface
- Conventions Used in This Book
- Using Code Examples
- O'Reilly Safari
- How to Contact Us
- Acknowledgments
- Colin
- Robin
- Chapter 1. Introduction
- Prerequisites
- Who This Book Is for and How to Use It
- What Is Efficiency?
- What Is Efficient R Programming?
- Why Efficiency?
- Cross-Transferable Skills for Efficiency
- Touch Typing
- Consistent Style and Code Conventions
- Benchmarking and Profiling
- Benchmarking
- Benchmarking Example
- Profiling
- Book Resources
- R Package
- Online Version
- References
- Chapter 2. Efficient Setup
- Prerequisites
- Top Five Tips for an Efficient R Setup
- Operating System
- Operating System and Resource Monitoring
- R Version
- Installing R
- Updating R
- Installing R Packages
- Installing R Packages with Dependencies
- Updating R Packages
- R Startup
- R Startup Arguments
- An Overview of R's Startup Files
- The Location of Startup Files
- The .Rprofile File
- Example .Rprofile File
- The .Renviron File
- RStudio
- Installing and Updating RStudio
- Window Pane Layout
- RStudio Options
- Autocompletion
- Keyboard Shortcuts
- Object Display and Output Table
- Project Management
- BLAS and Alternative R Interpreters
- Testing Performance Gains from BLAS
- Other Interpreters
- Useful BLAS/Benchmarking Resources
- References
- Chapter 3. Efficient Programming
- Prerequisites
- Top Five Tips for Efficient Programming
- General Advice
- Memory Allocation
- Vectorized Code
- Communicating with the User
- Fatal Errors: stop()
- Warnings: warning()
- Informative Output: message() and cat()
- Invisible Returns
- Factors
- Inherent Order
- Fixed Set of Categories
- The Apply Family
- Example: Movies Dataset
- Type Consistency
- Caching Variables
- Function Closures
- The Byte Compiler
- Example: The Mean Function
- Compiling Code
- References
- Chapter 4. Efficient Workflow
- Prerequisites
- Top Five Tips for Efficient Workflow
- A Project Planning Typology
- Project Planning and Management
- Chunking Your Work
- Making Your Workflow SMART
- Visualizing Plans with R
- Package Selection
- Searching for R Packages
- How to Select a Package
- Publication
- Dynamic Documents with R Markdown
- R Packages
- Reference
- Chapter 5. Efficient Input/Output
- Prerequisites
- Top Five Tips for Efficient Data I/O
- Versatile Data Import with rio
- Plain-Text Formats
- Differences Between fread() and read_csv()
- Preprocessing Text Outside R
- Binary File Formats
- Native Binary Formats: Rdata or Rds?
- The Feather File Format
- Benchmarking Binary File Formats
- Protocol Buffers
- Getting Data from the Internet
- Accessing Data Stored in Packages
- References
- Chapter 6. Efficient Data Carpentry
- Prerequisites
- Top Five Tips for Efficient Data Carpentry
- Efficient Data Frames with tibble
- Tidying Data with tidyr and Regular Expressions
- Make Wide Tables Long with gather()
- Split Joint Variables with separate()
- Other tidyr Functions
- Regular Expressions
- Efficient Data Processing with dplyr
- Renaming Columns
- Changing Column Classes
- Filtering Rows
- Chaining Operations
- Data Aggregation
- Nonstandard Evaluation
- Combining Datasets
- Working with Databases
- Databases and dplyr
- Data Processing with data.table
- References
- Chapter 7. Efficient Optimization
- Prerequisites
- Top Five Tips for Efficient Optimization
- Code Profiling
- Getting Started with profvis
- Example: Monopoly Simulation
- Efficient Base R
- The if() Versus ifelse() Functions
- Sorting and Ordering
- Reversing Elements
- Which Indices are TRUE?
- Converting Factors to Numerics
- Logical AND and OR
- Row and Column Operations
- is.na() and anyNA()
- Matrices
- Example: Optimizing the move_square() Function
- Parallel Computing
- Parallel Versions of Apply Functions
- Example: Snakes and Ladders
- Exit Functions with Care
- Parallel Code under Linux and OS X
- Rcpp
- A Simple C++ Function
- The cppFunction() Command
- C++ Data Types
- The sourceCpp() Function
- Vectors and Loops
- Matrices
- C++ with Sugar on Top
- Rcpp Resources
- References
- Chapter 8. Efficient Hardware
- Prerequisites
- Top Five Tips for Efficient Hardware
- Background: What Is a Byte?
- Random Access Memory
- Hard Drives: HDD Versus SSD
- Operating Systems: 32-Bit or 64-Bit
- Central Processing Unit
- Cloud Computing
- Amazon EC2
- Chapter 9. Efficient Collaboration
- Prerequisites
- Top Five Tips for Efficient Collaboration
- Coding Style
- Reformatting Code with RStudio
- Filenames
- Loading Packages
- Commenting
- Object Names
- Example Package
- Assignment
- Spacing
- Indentation
- Curly Braces
- Version Control
- Commits
- Git Integration in RStudio
- GitHub
- Branches, Forks, Pulls, and Clones
- Code Review
- References
- Chapter 10. Efficient Learning
- Prerequisties
- Top Five Tips for Efficient Learning
- Using R's Internal Help
- Searching R for Topics
- Finding and Using Vignettes
- Getting Help on Functions
- Reading R Source Code
- swirl
- Online Resources
- Stack Overflow
- Mailing Lists and Groups
- Asking a Question
- Minimal Dataset
- Minimal Example
- Learning In Depth
- Spread the Knowledge
- References
- Appendix A. Package Dependencies
- Appendix B. References
- Index
- About the Authors
- Colophon
System requirements
File format: PDF
Copy-Protection: Adobe-DRM (Digital Rights Management)
System requirements:
- Computer (Windows; MacOS X; Linux): Install the free reader Adobe Digital Editions prior to download (see eBook Help).
- Tablet/smartphone (Android; iOS): Install the free app Adobe Digital Editions or the app PocketBook before downloading (see eBook Help).
- E-reader: Bookeen, Kobo, Pocketbook, Sony, Tolino and many more (only limited: Kindle).
The file format PDF always displays a book page identically on any hardware. This makes PDF suitable for complex layouts such as those used in textbooks and reference books (images, tables, columns, footnotes). Unfortunately, on the small screens of e-readers or smartphones, PDFs are rather annoying, requiring too much scrolling.
This eBook uses Adobe-DRM, a „hard” copy protection. If the necessary requirements are not met, unfortunately you will not be able to open the eBook. You will therefore need to prepare your reading hardware before downloading.
Please note: We strongly recommend that you authorise using your personal Adobe ID after installation of any reading software.
For more information, see our eBook Help page.