From e2965d5685229ecaf303073645dd364c50af23d9 Mon Sep 17 00:00:00 2001 From: Radu Grosu Date: Sat, 13 Feb 2016 14:01:43 +0000 Subject: [PATCH] Update lists.Rmd typos --- lists.Rmd | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/lists.Rmd b/lists.Rmd index d1fadfb..a85ce52 100644 --- a/lists.Rmd +++ b/lists.Rmd @@ -10,7 +10,7 @@ library(purrr) source("common.R") ``` -In this chapter, you'll learn how to handle lists, the data structure R uses for complex, hierarchical objects. You've already familiar with vectors, R's data structure for 1d objects. Lists extend these ideas to model objects that are like trees. You can create a hierarchical structure with a list because unlike vectors, a list can contain other lists. +In this chapter, you'll learn how to handle lists, the data structure R uses for complex, hierarchical objects. You're already familiar with vectors, R's data structure for 1d objects. Lists extend these ideas to model objects that are like trees. You can create a hierarchical structure with a list because unlike vectors, a list can contain other lists. If you've worked with list-like objects before, you're probably familiar with the for loop. I'll talk a little bit about for loops here, but the focus will be functions from the __purrr__ package. purrr makes it easier to work with lists by eliminating common for loop boilerplate so you can focus on the specifics. The apply family of functions in base R (`apply()`, `lapply()`, `tapply()`, etc) solve a similar problem, but purrr is more consistent and easier to learn. @@ -23,11 +23,11 @@ The goal of using purrr functions instead of for loops is to allow you break com 1. If you're solving a complex problem, how can you break it down into bite sized pieces that allow you to advance one small step towards a solution? With purrr, you get lots of small pieces that you can - combose together with the pipe. + compose together with the pipe. This structure makes it easier to solve new problems. It also makes it easier to understand your solutions to old problems when you re-read your old code. -In later chapters you'll learn how to apply these ideas when modelling. You can often use multiple simple models to help understand a complex dataset, or you might have multiple models because you're bootstrapping or cross-validating. The techniques you learn in this chapter will be invaluable. +In later chapters you'll learn how to apply these ideas when modelling. You can often use multiple simple models to help understand a complex dataset, or you might have multiple models because you're bootstrapping or cross-validating. The techniques you'll learn in this chapter will be invaluable.