Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

re written chapter 25 + renders with quarto #291

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
e4c72f4
wrap removed from knitr
pachadotdev Jan 23, 2024
4f0e71e
fun factories: fix tibble dimensions
pachadotdev Jan 23, 2024
9992837
fix DESCRIPTION warning
pachadotdev Jan 23, 2024
2268729
explicitly install emo:: from github
pachadotdev Jan 23, 2024
93afcaa
add Pacha to aut
pachadotdev Jan 23, 2024
5e102b6
quarto ok up to S4
pachadotdev Jan 23, 2024
ab6875c
final part except cpp chapter
pachadotdev Jan 24, 2024
3261d63
cpp chapter
pachadotdev Jan 24, 2024
37132b3
IMPORTANT ch24 now uses fixest bc speedglm fails with Golub matrices …
pachadotdev Jan 24, 2024
5b89571
chunk ch10_29 works in the HTML but not in the PDF
pachadotdev Jan 24, 2024
98c9e4d
chunk ch11_12 works in the HTML but not in the PDF
pachadotdev Jan 24, 2024
4327390
chunk ch11_12 works in the HTML but not in the PDF
pachadotdev Jan 24, 2024
d8f4e55
chunk ch18_17 works in the HTML but not in the PDF
pachadotdev Jan 24, 2024
9528ec6
chunk ch23_09 works in the HTML but not in the PDF
pachadotdev Jan 24, 2024
0b48379
chunk ch23_10 works in the HTML but not in the PDF
pachadotdev Jan 24, 2024
e7a22ac
chunk ch24_12/19/22/23/24 works in the HTML but not in the PDF
pachadotdev Jan 24, 2024
d1c6932
quarto html renders properly
pachadotdev Jan 24, 2024
5f7b501
qmd renames
pachadotdev Jan 24, 2024
3bea609
tidy build
pachadotdev Jan 24, 2024
1c1763f
tidy description
pachadotdev Jan 24, 2024
b590cc9
cpp examples
pachadotdev Jan 24, 2024
be9ee2f
Rbuildignore
pachadotdev Jan 24, 2024
546f83a
cpp11 bindings
pachadotdev Jan 24, 2024
d17bc71
rendered site
pachadotdev Jan 24, 2024
51a78dc
quarto render to netlify
pachadotdev Mar 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
^\.netlify$
^\.github$
^\.quarto$
^\.vscode$
^cpp$
^emoji$
^99-rename-rmd-to-qmd\.sh$
^advancedrsolutions\.Rproj$
^images$
.*\.bib$
.*\.cls$
.*\.csl$
.*\.csv$
.*\.md$
.*\.qmd$
.*\.rds$
.*\.r$
.*\.R$
.*tex$
^_.*
.*_cache$
.*_files$
^docs$
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
*.Rmd linguist-language=R
*.qmd linguist-language=R
*.R linguist-language=R
86 changes: 39 additions & 47 deletions .github/workflows/bookdown.yaml
Original file line number Diff line number Diff line change
@@ -1,61 +1,53 @@
on:
push:
branches:
- main
branches: main

name: bookdown
name: Render and Publish

jobs:
build:
runs-on: macOS-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
build-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2

- name: Check out repository
uses: actions/checkout@v3
- name: Setup R
uses: r-lib/actions/setup-r@v1
uses: r-lib/actions/setup-r@v2

- name: Install pandoc and pandoc citeproc
run: |
brew install pandoc
- name: Setup pandoc
uses: r-lib/actions/setup-pandoc@v2

- name: Cache Renv packages
uses: actions/cache@v2
with:
path: $HOME/.local/share/renv
key: r-${{ hashFiles('renv.lock') }}
restore-keys: r-
- name: Get R version
id: get-r-version
run: echo "version=$(Rscript -e 'cat(as.character(getRversion()))')" >> $GITHUB_OUTPUT
shell: bash

- name: Cache bookdown results
uses: actions/cache@v2
- name: Cache R packages
uses: actions/cache@v3
with:
path: _bookdown_files
key: bookdown-${{ hashFiles('**/*Rmd') }}
restore-keys: bookdown-
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ steps.get-r-version.outputs.version }}-3-

- name: Install packages
- name: Install dependencies
run: |
R -e 'install.packages("renv")'
R -e 'renv::restore()'
R -e 'install.packages("remotes")'
R -e 'remotes::install_github("hadley/emo")'
R -e 'remotes::install_github("rstudio/bslib")'
R -e 'remotes::install_deps(dependencies = TRUE)'

- name: Build site
run: Rscript -e 'bookdown::render_book("index.Rmd", quiet = TRUE)'

- name: Install npm
uses: actions/setup-node@v1

- name: Deploy to Netlify
if: github.ref == 'refs/heads/main'
# NETLIFY_AUTH_TOKEN and NETLIFY_SITE_ID added in the repo's secrets
env:
install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/")
pak::local_install_dev_deps()
shell: Rscript {0}

- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2
with:
tinytex: false

# - name: Publish to GitHub Pages (and render)
# uses: quarto-dev/quarto-actions/publish@v2
# with:
# target: gh-pages
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # this secret is always available for github actions

- name: Publish to Netlify (and render)
uses: quarto-dev/quarto-actions/publish@v2
with:
target: netlify
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
run: |
npm install netlify-cli -g
netlify deploy --prod --dir=_book
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ libs
*.md
*_files
*_cache
.Rbuildignore
.idea
_main.docx

/.quarto/
_freeze
_cache$
pdf.tex
/.vscode/
41 changes: 0 additions & 41 deletions .travis.yml

This file was deleted.

364 changes: 0 additions & 364 deletions 000_Backpage_old.Rmd

This file was deleted.

2 changes: 0 additions & 2 deletions book_cover.Rmd → 00_01_Book_Cover.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -153,5 +153,3 @@ ggraph(mygraph, layout = 'circlepack') +
# geom_node_label( aes(label = part_label), color = "white", size = 5, fill = alpha(c("white"), 0), label.size = 0) +
# geom_node_label( aes(label = chapter_label, color = as.factor(depth)), size = 5, fill = alpha(c("white"), 0), label.size = 0)
```


18 changes: 13 additions & 5 deletions 01_Preface.Rmd → 00_02_Preface.qmd
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
bibliography: references.bib
---

# Preface {-}

Welcome to *Advanced R Solutions*!
Expand Down Expand Up @@ -72,7 +76,7 @@ contribs_all <- contribs_all %>% unique()

# Get info for all contributors
needed_json <- map(
contribs_all$login,
contribs_all$login,
~ gh::gh("/users/:username", username = .x)
)
info_all <- tibble(
Expand All @@ -88,15 +92,15 @@ write_csv(info_all, "contributors.csv")
library(dplyr)
contributors <- read.csv("contributors.csv", encoding = "UTF-8")

contributors <- contributors %>%
filter(!login %in% c("hadley", "henningsway", "Tazinho", "toebR")) %>%
contributors <- contributors %>%
filter(!login %in% c("hadley", "henningsway", "Tazinho", "toebR")) %>%
mutate(
login = paste0("\\@", login),
desc = ifelse(is.na(name), login, paste0(name, " (", login, ")"))
) %>%
) %>%
arrange(login)

cat(glue::glue_collapse(contributors$desc, sep = ", ", last = ", and "))
cat(glue::glue_collapse(contributors$desc, sep = ", ", last = ", and "))
cat(".\n")
```

Expand Down Expand Up @@ -140,3 +144,7 @@ See you around!
Malte Grosser [`@malte_grosser`](https://twitter.com/malte_grosser)

Henning Bumann [`@henningsway`](https://twitter.com/henningsway)

Mauricio Vargas Sepulveda `m.sepulveda@mail.utoronto.ca`

## References
Loading