f0nzie / dataviz-rsuite

Data Visualization book by Claus WIlke using rsuite

Home Page:https://f0nzie.github.io/dataviz-rsuite/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dataviz-rsuite

ebook built with rsuite. How is this different

This bookdown ebook Fundamentals of Data Visualization was originally created with bookdown by its author Claus Wilke. The version here is different in the way it has been built, and can be rebuilt, even from the bare metal. The focus is reproducibility.

I have used rsuite to make it fully reproducible and easier to knit. This ebook is, in some way, difficult to match or keep all the dependencies. Some packages will not be found in CRAN, or have newer versions in Github. To save all the package installation in the R global environment, I have chosen to create the book in an isolated environment with rsuite. Besides, since not all good things last forever, after a package upgrade the ebook may stop building. These are all the packages required to build this ebook:

  logging,
  bookdown,
  dviz.supp,
  tidyverse,
  patchwork,
  ggforce,
  ggrepel,
  ggridges,
  ggthemes,
  ggmap,
  ggtextures,
  ggplot2movies,
  ggspatial,
  gridExtra,
  treemapify,
  hexbin,
  magick,
  maps,
  tidybayes,
  broom,
  mgcv,
  emmeans,
  ungeviz,
  gganimate,
  RColorBrewer,
  gapminder,
  nycflights13,
  forcats,
  statebins,
  sf,
  geofacet,
  tidyr,
  tibble,
  dplyr,
  plot3D,
  stringr,
  lubridate,
  rworldmap,
  lwgeom,
  rstanarm,
  gifski,
  transformr,
  purrr

How is it done

So, what I did is creating an isolated rsuite master project for the book, one where all the packages are spelled out in advance so the ebook can be rebuilt after: (i) an R re-installation, (ii) a new R version, or (iii) a full package upgrade. The book will be able to be regenerated to the CRAN snapshot at the date it was first succesfully built.

Because rsuite allows a supervising project on top of other projects or packages, you can control the:

  1. date of the snapshot;
  2. R version under you want the book to be built;
  3. names of all the packages that satisfy the dependencies for the book to work;
  4. define a place for the source code of the package if the package is not in CRAN;
  5. a master project and a master package that takes care of reproducing the whole book, again and again, even after changing the operating system.
  6. a master environment with its own scripts and configuration files on top of projects and packages.
  7. depend less on make

How to reproduce this ebook yourself

  • Download and install the RSuite client. Available for Linux, Mac and Windows.

  • Install the rsuite package with rsuite install

  • Clone or download the ebook repository

  • Change to this repo folder and install the dependencies on its own isolated reproducible environment. Use rsuite proj depsinst

  • Build the project with rsuite proj build

  • In the terminal type this:

dataviz-rsuite$  Rscript R/build_final.R

for the final version of the book.

Warning. Do not build through RStudio. It will stop because of this error: Quitting from lines 13365-13460 (_main.Rmd). Error: $ operator is invalid for atomic vectors.

Or this:

dataviz-rsuite$  Rscript R/build_draft.R
  • Open the file index.html from the folder work/dataviz/_book_final or work/dataviz/_book.

Publishing this book in Github pages

To publish this book in Github pages:

  1. Push the folder ./work/dataviz/_book_final as the branch gh-pages with this git command from your terminal:
git subtree push --prefix work/dataviz/_book_final https://github.com/f0nzie/dataviz-rsuite.git gh-pages
  1. Activate gh-pages in your Github repository.

If you are building this in your own machine and own repository, change my username f0nzie by your own. This example assumes you are using https instead of ssh.

  1. Call this version of the book website from: https://f0nzie.github.io/dataviz-rsuite/

References

About

Data Visualization book by Claus WIlke using rsuite

https://f0nzie.github.io/dataviz-rsuite/


Languages

Language:HTML 94.8%Language:CSS 2.4%Language:JavaScript 1.4%Language:R 0.7%Language:TeX 0.5%Language:Shell 0.0%