Safari, the world’s most comprehensive technology and business learning platform.

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required

O'Reilly logo
R For Dummies, 2nd Edition

Book Description

Mastering R has never been easier

Picking up R can be tough, even for seasoned statisticians and data analysts. R For Dummies, 2nd Edition provides a quick and painless way to master all the R you'll ever need. Requiring no prior programming experience and packed with tons of practical examples, step-by-step exercises, and sample code, this friendly and accessible guide shows you how to know your way around lists, data frames, and other R data structures, while learning to interact with other programs, such as Microsoft Excel. You'll learn how to reshape and manipulate data, merge data sets, split and combine data, perform calculations on vectors and arrays, and so much more.

R is an open source statistical environment and programming language that has become very popular in varied fields for the management and analysis of data. R provides a wide array of statistical and graphical techniques, and has become the standard among statisticians for software development and data analysis. R For Dummies, 2nd Edition takes the intimidation out of working with R and arms you with the knowledge and know-how to master the programming language of choice among statisticians and data analysts worldwide.

  • Covers downloading, installing, and configuring R

  • Includes tips for getting data in and out of R

  • Offers advice on fitting regression models and ANOVA

  • Provides helpful hints for working with graphics

  • R For Dummies, 2nd Edition is an ideal introduction to R for complete beginners, as well as an excellent technical reference for experienced R programmers.

    Table of Contents

      1. Cover
      2. Introduction
        1. About This Book
        2. Changes in the Second Edition
        3. Conventions Used in This Book
        4. What You’re Not to Read
        5. Foolish Assumptions
        6. How This Book Is Organized
        7. Icons Used in This Book
        8. Beyond the Book
        9. Where to Go from Here
      3. Part I: Getting Started with R Programming
        1. Chapter 1: Introducing R: The Big Picture
          1. Recognizing the Benefits of Using R
          2. Looking At Some of the Unique Features of R
        2. Chapter 2: Exploring R
          1. Working with a Code Editor
          2. Starting Your First R Session
          3. Sourcing a Script
          4. Navigating the Environment
        3. Chapter 3: The Fundamentals of R
          1. Using the Full Power of Functions
          2. Keeping Your Code Readable
          3. Getting from Base R to More
      4. Part II: Getting Down to Work in R
        1. Chapter 4: Getting Started with Arithmetic
          1. Working with Numbers, Infinity, and Missing Values
          2. Organizing Data in Vectors
          3. Getting Values in and out of Vectors
          4. Working with Logical Vectors
          5. Powering Up Your Math
        2. Chapter 5: Getting Started with Reading and Writing
          1. Using Character Vectors for Text Data
          2. Manipulating Text
          3. Factoring in Factors
        3. Chapter 6: Going on a Date with R
          1. Working with Dates
          2. Presenting Dates in Different Formats
          3. Adding Time Information to Dates
          4. Formatting Dates and Times
          5. Performing Operations on Dates and Times
        4. Chapter 7: Working in More Dimensions
          1. Adding a Second Dimension
          2. Using the Indices
          3. Naming Matrix Rows and Columns
          4. Calculating with Matrices
          5. Adding More Dimensions
          6. Combining Different Types of Values in a Data Frame
          7. Manipulating Values in a Data Frame
          8. Combining Different Objects in a List
      5. Part III: Coding in R
        1. Chapter 8: Putting the Fun in Functions
          1. Moving from Scripts to Functions
          2. Using Arguments the Smart Way
          3. Coping with Scoping
          4. Dispatching to a Method
        2. Chapter 9: Controlling the Logical Flow
          1. Making Choices with if Statements
          2. Doing Something Else with an if. . .else Statement
          3. Vectorizing Choices
          4. Making Multiple Choices
          5. Looping Through Values
          6. Looping without Loops: Meeting the Apply Family
        3. Chapter 10: Debugging Your Code
          1. Knowing What to Look For
          2. Reading Errors and Warnings
          3. Going Bug Hunting
          4. Generating Your Own Messages
          5. Recognizing the Mistakes You’re Sure to Make
        4. Chapter 11: Getting Help
          1. Finding Information in the R Help Files
          2. Searching the Web for Help with R
          3. Getting Involved in the R Community
          4. Making a Minimal Reproducible Example
      6. Part IV: Making the Data Talk
        1. Chapter 12: Getting Data into and out of R
          1. Getting Data into R
          2. Getting Your Data out of R
          3. Working with Files and Folders
        2. Chapter 13: Manipulating and Processing Data
          1. Deciding on the Most Appropriate Data Structure
          2. Creating Subsets of Your Data
          3. Adding Calculated Fields to Data
          4. Combining and Merging Data Sets
          5. Sorting and Ordering Data
          6. Traversing Your Data with the Apply Functions
          7. Getting to Know the Formula Interface
          8. Whipping Your Data into Shape
        3. Chapter 14: Summarizing Data
          1. Starting with the Right Data
          2. Describing Continuous Variables
          3. Describing Categories
          4. Describing Distributions
          5. Describing Multiple Variables
          6. Working with Tables
        4. Chapter 15: Testing Differences and Relations
          1. Taking a Closer Look at Distributions
          2. Comparing Two Samples
          3. Testing Counts and Proportions
          4. Working with Models
      7. Part V: Working with Graphics
        1. Chapter 16: Using Base Graphics
          1. Creating Different Types of Plots
          2. Controlling Plot Options and Arguments
          3. Saving Graphics to Image Files
        2. Chapter 17: Creating Faceted Graphics with Lattice
          1. Creating a Lattice Plot
          2. Changing Plot Options
          3. Plotting Different Types
          4. Plotting Data in Groups
          5. Printing and Saving a Lattice Plot
        3. Chapter 18: Looking At ggplot2 Graphics
          1. Installing and Loading ggplot2
          2. Looking At Layers
          3. Using Geoms and Stats
          4. Sussing Stats
          5. Adding Facets, Scales, and Options
          6. Getting More Information
      8. Part VI: The Part of Tens
        1. Chapter 19: Ten Things You Can Do in R That You Would’ve Done in Microsoft Excel
          1. Adding Row and Column Totals
          2. Formatting Numbers
          3. Sorting Data
          4. Making Choices with If
          5. Calculating Conditional Totals
          6. Transposing Columns or Rows
          7. Finding Unique or Duplicated Values
          8. Working with Lookup Tables
          9. Working with Pivot Tables
          10. Using the Goal Seek and Solver
        2. Chapter 20: Ten Tips on Working with Packages
          1. Poking Around the Nooks and Crannies of CRAN
          2. Finding Interesting Packages
          3. Installing Packages
          4. Loading Packages
          5. Reading the Package Manual and Vignette
          6. Updating Packages
          7. Forging Ahead with R-Forge
          8. Getting packages from github
          9. Conducting Installations from BioConductor
          10. Reading the R Manual
      9. Appendix A: Installing R and RStudio
        1. Installing and Configuring R
        2. Installing and Configuring RStudio
      10. Appendix B: The rfordummies Package
        1. Using rfordummies
      11. About the Authors
      12. Cheat Sheet
      13. Connect with Dummies
      14. End User License Agreement