This is a clone of the fantastic
Pandas cookbook
by Julia Evans, but using the excellent R's data.table
package.
This cookbook provides you with concrete examples of analyzing real-world data
so that you'll find it easier to getting started with data.table
.
I am surprised that Julia's repo currently has about 4.1k stars (as of Oct
2019). To put the number in perspective, two of the most popular R packages
dplyr
and ggplot2
has 3.1k and 4.1k stars respectively (data.table
, by
the way, has been starred 2.1k times).
This project is my attempt to increase the reach of R
in general and
data.table
in particular, especially to beginners. I try my best to keep the
work of Julia as original as possible and also provide more detailed explanation
where necessary. Of course, all remaining errors are mine.
-
Chapter 2: Selecting data & finding the most common complaint type
-
Chapter 3: Which borough has the most noise complaints? (or, more selecting data)
-
Chapter 4: Find out on which weekday people bike the most with groupby and aggregate
-
Chapter 5: Combining dataframes and scraping Canadian weather data
- The easiest way is to clone the repository to your local computer. You need
the latest version of
R
(3.6.1) installed before you do the following instructions.
If you prefer working on command line:
git clone https://github.com/chuvanan/rdatatable-cookbook.git
cd rdatatable-cookbook # move to cookbook directory
R # start R session, right after initiation R will attempt to install `renv` (locally)
renv::restore() # restore all dependencies
In case you are more comfortable on RStudio, you need to set folder
rdatatable-cookbook
as working directory and run renv::init()
and later
renv::restore()
.
-
The above code will download the repository to your machine. And the great
renv
package will do the critical job that makes sure you have all required packages to run the code yourself. -
All R Markdown files are stored in folder
cookbook
. You are ready to go.
- I would love your feedback on anything. Just drop me an email or send a pull request.
- This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License
- A Vietnamese version of this repo can be found here (work in progress).