2016-10-12 22:27:58 +08:00
# R for Data Science
2022-03-21 22:24:42 +08:00
2022-04-13 22:23:20 +08:00
<!-- badges: start -->
2023-01-10 21:47:17 +08:00
[![Render and deploy Book to Netlify ](https://github.com/hadley/r4ds/actions/workflows/build_book.yaml/badge.svg )](https://github.com/hadley/r4ds/actions/workflows/build_book.yaml)
2022-04-13 22:23:20 +08:00
<!-- badges: end -->
2015-07-28 05:52:19 +08:00
2022-11-12 06:11:00 +08:00
This repository contains the source of [R for Data Science ](http://r4ds.hadley.nz ) book.
2022-07-29 20:46:19 +08:00
The book is built using [Quarto ](https://quarto.org/ ).
2015-07-28 05:52:19 +08:00
2022-03-21 22:24:42 +08:00
## Images
### Omnigraffle drawings
2022-08-29 18:24:32 +08:00
- Font: 12pt Guardian Sans Condensed / Ubuntu mono
2022-03-21 22:24:42 +08:00
- Export as 300 dpi png.
2022-08-29 18:24:32 +08:00
- Website font is 18 px = 13.5 pt, so scale dpi to match font sizes: 270 = 300 \* 12 / 13.5.
(I also verified this empirically by screenshotting.)
2022-04-13 22:23:20 +08:00
2022-08-29 18:24:32 +08:00
``` r
2022-03-21 22:24:42 +08:00
#| echo: FALSE
#| out.width: NULL
knitr::include_graphics("diagrams/transform.png", dpi = 270)
2022-08-29 18:24:32 +08:00
```
### Screenshots
- Make sure you're using a light theme.
For small interface elements (eg. toolbars), zoom in twice.
- Screenshot with Cmd + Shift + 4.
- Don't need to set dpi:
``` r
#| echo: FALSE
#| out.width: NULL
knitr::include_graphics("screenshots/rstudio-wg.png")
```
2022-03-21 22:24:42 +08:00
2022-11-19 01:05:00 +08:00
### O'Reilly
To generate book for O'Reilly, build the book then:
```{r}
2023-01-27 00:36:07 +08:00
# pak::pak("hadley/htmlbook")
htmlbook::convert_book()
2022-11-19 01:05:00 +08:00
html < - list . files ( " oreilly " , pattern = "[.]html$" , full . names = TRUE)
file.copy(html, "../r-for-data-science-2e/", overwrite = TRUE)
2022-11-19 01:26:25 +08:00
pngs < - list . files ( " oreilly " , pattern = "[.]png$" , full . names = TRUE, recursive = TRUE)
dest < - gsub ( " oreilly " , " . . / r-for-data-science-2e / " , pngs )
fs::dir_create(unique(dirname(dest)))
file.copy(pngs, dest, overwrite = TRUE)
2022-11-19 01:05:00 +08:00
```
2023-01-27 00:36:07 +08:00
Then commit and push to atlas.
2020-10-06 06:56:27 +08:00
## Code of Conduct
2022-03-21 22:24:42 +08:00
Please note that r4ds uses a [Contributor Code of Conduct ](https://contributor-covenant.org/version/2/0/CODE_OF_CONDUCT.html ).
By contributing to this book, you agree to abide by its terms.