Welcome to the Big Book of R repository! This repository hosts a collection of nearly 400 R programming books, most of which are freely available. The project is open to contributions of both free and paid books.
To work with this repository, you need to have some tools and libraries installed on your system:
- Quarto: We use Quarto to render the books. Make sure Quarto is installed on your machine.
- R Programming Environment: Ensure that R is installed.
- R Libraries: Install the following R libraries:
library(dplyr) library(tidyr) library(stringr) library(googlesheets4) library(readr)
- R studio or Visual Studio Code (VS Code): This project is best managed using R studio or VS Code.
_quarto.yml
: The primary configuration file that manages the rendering of books and calls all.qmd
files.chapters/
: Directory where individual.qmd
files are stored after fetching data from the Google Sheets.scripts/
:fetch_books.R
: Script to fetch book data from Google Sheets, create.qmd
files in thechapters
directory, and generate thechapter_list.txt
.chapter_list.txt
: Text file containing the list of.qmd
files with their paths, generated byfetch_books.R
.
- HTML files: these are part of the book rendering process.
-
Clone the repository to your local machine. Use the git command to clone the repository:
git clone [repository-url]
-
Install all the prerequisites mentioned above. Ensure that all necessary tools and libraries, as specified in the project documentation, are installed on your system.
-
Ensure R and necessary libraries are installed. Use the following commands in your R console to install the required R packages if not already installed:
install.packages("dplyr") install.packages("tidyr") install.packages("stringr") install.packages("googlesheets4") install.packages("readr")
-
Run the
fetch_books.R
script to automate data fetching. This script automatically populates thechapters
directory and generates thechapter_list.txt
file. It is designed to facilitate the addition of new book entries without needing manual updates to the project structure: -
Preview the book locally. Immediately after running the
fetch_books.R
, preview the book using:quarto preview
This step ensures that the newly fetched content renders correctly without errors.
- Update the Quarto book structure for new chapters.
If structural changes are required due to the addition of new chapters, manually update the
_quarto.yml
file:- Delete outdated content:
Remove all content in the
chapters
directory and the existingchapter_list.txt
file. - Re-run
fetch_books.R
: Fetch the latest data to reflect the new chapter entries and generate updated.qmd
files. - Manually update
_quarto.yml
: Incorporate changes from the newchapter_list.txt
into_quarto.yml
to align with the new chapter structure. - Preview changes:
Run
quarto preview
to verify that all updates are rendered correctly before committing the changes to the repository.
- Delete outdated content:
Remove all content in the
This revised documentation now clearly separates the automated process for adding new book entries from the manual process required for new chapter entries, including necessary updates to the _quarto.yml
configuration.
To set up GitHub Pages and GitHub Actions, please refer to the detailed guide available here: Setting Up GitHub Pages and Actions
We welcome contributions! If you wish to add books or suggest improvements:
- Please open an issue through this link: Issue Tracker.
- Follow the contribution guidelines provided in the repository.
The metadata about the books is stored in a Google Sheet, accessible here.
For any further assistance, please refer to the issue tracker and the README within the repository.