forked from r-earthengine/rgeebook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Preface.Rmd
44 lines (30 loc) · 3.22 KB
/
Preface.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Preface {-}
Welcome to the second edition of _Advanced R_. I had three main goals for this edition:
* Improve coverage of important concepts that I fully understood only after
the publication of the first edition.
* Reduce coverage of topics time has shown to be less useful, or that I think
are really exciting but turn out not to be that practical.
* Generally make the material easier to understand with better text, clearer
code, and many more diagrams.
If you're familiar with the first edition, this preface describes the major changes so that you can focus your reading on the new areas. If you're reading a printed version of this book you'll notice one big change very quickly: _Advanced R_ is now in colour! This has considerably improved the syntax highlighting of code chunks, and made it much easier to create helpful diagrams. I have taken advantage of this and included over 100 new diagrams throughout the book.
Another big change in this version is the use of new packages, particularly [rlang](http://rlang.r-lib.org), which provides a clean interface to low-level data structures and operations. The first edition used base R functions almost exclusively, which created some pedagogical challenges because many functions evolved independently over multiple years, making it hard to see the big underlying ideas hidden amongst the incidental variations in function names and arguments. I continue to show base equivalents in sidebars, footnotes, and where needed, in individual sections, but if you want to see the purest base R expression of the ideas in this book, I recommend reading the first edition, which you can find online at <http://adv-r.had.co.nz>.
The foundations of R have not changed in the five years since the first edition, but my understanding of them certainly has. Thus, the overall structure of "Foundations" has remained roughly the same, but many of the individual chapters have been considerably improved:
* Chapter \@ref(names-values), "Names and values", is a brand new chapter
that helps you understand the difference between objects and names of
objects. This helps you more accurately predict when R will make a copy of
a data structure, and lays important groundwork to understand functional
programming.
While the second edition has mostly expanded coverage of existing material, five chapters have been removed:
* The vocabulary chapter has been removed because it was always a bit of an odd
duck, and there are more effective ways to present vocabulary lists than in a
book chapter.
* The style chapter has been replaced with an online style guide,
<http://style.tidyverse.org/>. The style guide is paired with the new
styler package [@styler] which can automatically apply many of the rules.
* The C chapter has been moved to <https://github.com/hadley/r-internals>, which, over time, will provide
a guide to writing C code that works with R's data structures.
* The memory chapter has been removed. Much of the material has been integrated
into Chapter \@ref(names-values) and the remainder felt excessively technical
and not that important to understand.
* The chapter on R's performance as a language was removed. It delivered
few actionable insights, and became dated as R changed.