The goal of dataedu is to provide readers of Data Science in Education Using R with a package with useful functions, data, and references from the book.
First, let’s install devtools, an R package with many handy R tools. In your R console, type in:
install.packages("devtools")
If you already have {devtools} installed, you can move on to the next step.
If you are not sure whether you have it installed, you can run this function, which will install {devtools} if you do not already have it.
if (!require(devtools)) {
install.packages("devtools")
library(devtools)
}
You can install the development version of {dataedu} by running this in your R Studio console:
devtools::install_github("data-edu/dataedu")
Before you can use the package, make sure to call it using library()
:
library(dataedu)
We created this package to provide our readers an opportunity to jump into R however they see fit.
- Mass installation of all the packages used in the book
- Reproducible code for the walkthroughs
- The dataedu theme and color palette for reuse
We strived to use packages that we use in our daily work when creating the walkthroughs in the book. Because we covered a variety of subjects, that means we used a lot of packages! As described in the Foundational Skills chapter, you can install the packages individually as they suit your needs.
However, if you want to quickly get started and download all the
packages at once, please use mass_install()
. This function uses the
very handy p_install()
from the
pacman package, which facilitates
the installation and loading of packages.
dataedu::mass_install()
To see the packages used in the book, run:
dataedu::all_packages
#> [1] "apaTables" "caret" "dummies" "ggraph" "here"
#> [6] "janitor" "lme4" "lubridate" "performance" "readxl"
#> [11] "rtweet" "randomNames" "sjPlot" "tidygraph" "tidylog"
#> [16] "tidyverse" "tidytext"
A special note on {tabulizer}: One of the walkthroughs uses
tabulizer, created by ROpenSci
to read PDFs. {tabulizer} requires the installation of
RJava, which
can be a tricky process on Mac computers. {tabulizer} is not included in
mass_install()
and we recommend reading through the notes on its
Github repo if installing.
As in following, simply add the theme and palette to ggplot2-based plots:
library(ggplot2)
library(dataedu)
ggplot(midwest, aes(x = area, y = popdensity, color = state)) +
geom_point() +
theme_dataedu() +
scale_color_dataedu()
- Please report ideas or issues on the Issues page. If possible, make your post reproducible using the reprex package.
- Send any pull requests on the Github repository.