r4ds
r4ds copied to clipboard
Typo in value of `pi` in Figure 20.2
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.
2e update: This typo is now in https://r4ds.hadley.nz/vectors.html#subsetting-2.
This figure is going away in the 2ed.