r4ds icon indicating copy to clipboard operation
r4ds copied to clipboard

Typo in value of `pi` in Figure 20.2

Open gvelasq opened this issue 2 years ago • 1 comments

Happy Pi Day! There's a small typo in the top left of Figure 20.2 where the third element of list a is meant to show pi rounded to 6 decimals. The current value shown in the figure is 3.141525 and the correct value should be 3.141593 as per the reprex below.

a <- list(a = 1:3, b = "a string", c = pi, d = list(-1, -5))

purrr::walk(a, ~ print(.x))
#> [1] 1 2 3
#> [1] "a string"
#> [1] 3.141593
#> [[1]]
#> [1] -1
#> 
#> [[2]]
#> [1] -5

Created on 2022-03-14 by the reprex package (v2.0.1)

Edit: Added link to Figure 20.2 above. In the paperback version it is Figure 16.2.

gvelasq avatar Mar 14 '22 22:03 gvelasq

2e update: This typo is now in https://r4ds.hadley.nz/vectors.html#subsetting-2.

image

mine-cetinkaya-rundel avatar May 09 '22 17:05 mine-cetinkaya-rundel

This figure is going away in the 2ed.

hadley avatar Sep 10 '22 13:09 hadley