oscarbaruffa / BigBookofR

The biggest collection of R books (and maybe later some other resources too)
https://www.bigbookofr.com/
543 stars 162 forks source link

Big Book of R

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.

Getting Started

To work with this repository, you need to have some tools and libraries installed on your system:

Prerequisites

Repository Structure

Setting Up Your Local Environment

  1. Clone the repository to your local machine. Use the git command to clone the repository:

    git clone [repository-url]
  2. Install all the prerequisites mentioned above. Ensure that all necessary tools and libraries, as specified in the project documentation, are installed on your system.

  3. 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")

    Automated process for new book entries

  4. Run the fetch_books.R script to automate data fetching. This script automatically populates the chapters directory and generates the chapter_list.txt file. It is designed to facilitate the addition of new book entries without needing manual updates to the project structure:

  5. 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.

Manual process for new chapter entries

  1. 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 existing chapter_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 new chapter_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.

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

Contribution Guidelines

We welcome contributions! If you wish to add books or suggest improvements:

Additional Information

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.