Efficient R Programming. A Practical Guide to Smarter Programming - Helion

ISBN: 978-14-919-5073-9
stron: 222, Format: ebook
Data wydania: 2016-12-08
Księgarnia: Helion
Cena książki: 29,90 zł (poprzednio: 135,91 zł)
Oszczędzasz: 78% (-106,01 zł)
There are many excellent R resources for visualization, data science, and package development. Hundreds of scattered vignettes, web pages, and forums explain how to use R in particular domains. But little has been written on how to simply make R work effectively—until now. This hands-on book teaches novices and experienced R users how to write efficient R code.
Drawing on years of experience teaching R courses, authors Colin Gillespie and Robin Lovelace provide practical advice on a range of topics—from optimizing the set-up of RStudio to leveraging C++—that make this book a useful addition to any R user’s bookshelf. Academics, business users, and programmers from a wide range of backgrounds stand to benefit from the guidance in Efficient R Programming.
- Get advice for setting up an R programming environment
- Explore general programming concepts and R coding techniques
- Understand the ingredients of an efficient R workflow
- Learn how to efficiently read and write data in R
- Dive into data carpentry—the vital skill for cleaning raw data
- Optimize your code with profiling, standard tricks, and other methods
- Determine your hardware capabilities for handling R computation
- Maximize the benefits of collaborative R programming
- Accelerate your transition from R hacker to R programmer
Osoby które kupowały "Efficient R Programming. A Practical Guide to Smarter Programming", wybierały także:
- Fundamentals of Metadata Management. Uncover the Meta Grid and Unlock IT, Data, Information, and Knowledge Management 249,17 zł, (29,90 zł -88%)
- Semantic Modeling for Data 249,17 zł, (29,90 zł -88%)
- Power BI Desktop. Kurs video. Wykorzystanie narzędzia w analizie i wizualizacji danych 332,50 zł, (39,90 zł -88%)
- The Practitioner's Guide to Graph Data. Applying Graph Thinking and Graph Technologies to Solve Complex Problems 230,00 zł, (29,90 zł -87%)
- R Cookbook. Proven Recipes for Data Analysis, Statistics, and Graphics. 2nd Edition 230,00 zł, (29,90 zł -87%)
Spis treści
Efficient R Programming. A Practical Guide to Smarter Programming eBook -- spis treści
- Preface
- Conventions Used in This Book
- Using Code Examples
- OReilly Safari
- How to Contact Us
- Acknowledgments
- Colin
- Robin
- 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
- Exercises
- Book Resources
- R Package
- Online Version
- References
- 2. Efficient Setup
- Prerequisites
- Top Five Tips for an Efficient R Setup
- Operating System
- Operating System and Resource Monitoring
- Exercises
- Operating System and Resource Monitoring
- R Version
- Installing R
- Updating R
- Installing R Packages
- Installing R Packages with Dependencies
- Updating R Packages
- Exercises
- R Startup
- R Startup Arguments
- An Overview of Rs Startup Files
- The Location of Startup Files
- The .Rprofile File
- Example .Rprofile File
- Setting options
- Setting the CRAN mirror
- The fortunes package
- Useful functions
- Creating hidden environments with .Rprofile
- The .Renviron File
- Example .Renviron file
- Exercises
- RStudio
- Installing and Updating RStudio
- Window Pane Layout
- Exercises
- RStudio Options
- Autocompletion
- Keyboard Shortcuts
- Object Display and Output Table
- Project Management
- Exercises
- BLAS and Alternative R Interpreters
- Testing Performance Gains from BLAS
- Other Interpreters
- Useful BLAS/Benchmarking Resources
- Exercise
- References
- 3. Efficient Programming
- Prerequisites
- Top Five Tips for Efficient Programming
- General Advice
- Exercise
- Memory Allocation
- Vectorized Code
- Exercises
- Example: Monte Carlo integration
- Exercise
- Communicating with the User
- Fatal Errors: stop()
- Warnings: warning()
- Informative Output: message() and cat()
- Exercise
- Invisible Returns
- Factors
- Inherent Order
- Fixed Set of Categories
- Exercise
- The Apply Family
- Example: Movies Dataset
- Type Consistency
- Other resources
- Exercises
- Caching Variables
- Exercise
- Function Closures
- Exercises
- The Byte Compiler
- Example: The Mean Function
- Compiling Code
- References
- 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
- Exercises
- Package Selection
- Searching for R Packages
- How to Select a Package
- Publication
- Dynamic Documents with R Markdown
- R Packages
- Reference
- 5. Efficient Input/Output
- Prerequisites
- Top Five Tips for Efficient Data I/O
- Versatile Data Import with rio
- Exercises
- 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
- 6. Efficient Data Carpentry
- Prerequisites
- Top Five Tips for Efficient Data Carpentry
- Efficient Data Frames with tibble
- Exercise
- Tidying Data with tidyr and Regular Expressions
- Make Wide Tables Long with gather()
- Split Joint Variables with separate()
- Other tidyr Functions
- Regular Expressions
- Exercises
- Efficient Data Processing with dplyr
- Renaming Columns
- Changing Column Classes
- Filtering Rows
- Chaining Operations
- Exercises
- Data Aggregation
- Exercises
- Nonstandard Evaluation
- Combining Datasets
- Working with Databases
- Databases and dplyr
- Exercises
- Databases and dplyr
- Data Processing with data.table
- References
- 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
- The integer data type
- Sparse matrices
- Exercises
- Example: Optimizing the move_square() Function
- Exercise
- 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
- Exercises
- Matrices
- C++ with Sugar on Top
- Exercises
- Rcpp Resources
- References
- 8. Efficient Hardware
- Prerequisites
- Top Five Tips for Efficient Hardware
- Background: What Is a Byte?
- Random Access Memory
- Exercises
- Hard Drives: HDD Versus SSD
- Operating Systems: 32-Bit or 64-Bit
- Exercises
- Central Processing Unit
- Cloud Computing
- Amazon EC2
- Exercise
- Amazon EC2
- 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
- Exercise
- Version Control
- Commits
- Git Integration in RStudio
- GitHub
- Branches, Forks, Pulls, and Clones
- Code Review
- References
- 10. Efficient Learning
- Prerequisties
- Top Five Tips for Efficient Learning
- Using Rs 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
- A. Package Dependencies





