From a61c127b70efcb29bfbc74eb2b5b0366ef606266 Mon Sep 17 00:00:00 2001 From: yahwes Date: Mon, 10 Oct 2016 16:53:47 -0500 Subject: [PATCH] fix typos (#462) --- import.Rmd | 2 +- program.Rmd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/import.Rmd b/import.Rmd index 6f194c8..b8811c6 100644 --- a/import.Rmd +++ b/import.Rmd @@ -292,7 +292,7 @@ fruit <- c("apple", "banana") parse_factor(c("apple", "banana", "bananana"), levels = fruit) ``` -But it you many problematic entries, it's often easier to leave as character vectors and then use the tools you'll learn about in [strings] and [factors] to clean them up. +But if you have many problematic entries, it's often easier to leave as character vectors and then use the tools you'll learn about in [strings] and [factors] to clean them up. ### Dates, date-times, and times {#readr-datetimes} diff --git a/program.Rmd b/program.Rmd index 840287c..0497e2f 100644 --- a/program.Rmd +++ b/program.Rmd @@ -8,7 +8,7 @@ In this part of the book, you'll improve your programming skills. Programming is knitr::include_graphics("diagrams/data-science-program.png") ``` -Programming produces code, and code is a tool of communication. Obviously code tells the computer what you want it to do. But it also communicates meaning to other humans. Thinking about code as a vehicle for communication is important because every project you do is fundamentally collaborative. Even if you're not working with other people, you'll definitely be working with future-you! Writing clear code is important so that others (like future-you) can understand why you tackled an analysis in the way you did. That means getting better at programming also involves get better at communicating. Over time, you want your code to become not just easier to write, but easier for others to read. +Programming produces code, and code is a tool of communication. Obviously code tells the computer what you want it to do. But it also communicates meaning to other humans. Thinking about code as a vehicle for communication is important because every project you do is fundamentally collaborative. Even if you're not working with other people, you'll definitely be working with future-you! Writing clear code is important so that others (like future-you) can understand why you tackled an analysis in the way you did. That means getting better at programming also involves getting better at communicating. Over time, you want your code to become not just easier to write, but easier for others to read. Writing code is similar in many ways to writing prose. One parallel which I find particularly useful is that in both cases rewriting is the key to clarity. The first expression of your ideas is unlikely to be particularly clear, and you may need to rewrite multiple times. After solving a data analysis challenge, it's often worth looking at your code and thinking about whether or not it's obvious what you've done. If you spend a little time rewriting your code while the ideas are fresh, you can save a lot of time later trying to recreate what your code did. But this doesn't mean you should rewrite every function: you need to balance what you need to achieve now with saving time in the long run. (But the more you rewrite your functions the more likely your first attempt will be clear.)