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

using dplyr::bind_rows instead of rbind_all() in chapter-01 #308

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
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
9 changes: 6 additions & 3 deletions 01-introduction.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ As emphasised in the next section, it's useful to run code and experiment as you

- A working installation of R on your computer (see Section \@ref(install-rstudio)).

- Install and load the **microbenchmark**, **profvis** and **ggplot2** packages (see Section \@ref(installing-r-packages) for tips on installing packages and keeping them up-to-date). You can ensure these packages are installed by loading them as follows:
- Install and load the **microbenchmark**, **profvis**, **readr** and **ggplot2** packages (see Section \@ref(installing-r-packages) for tips on installing packages and keeping them up-to-date). You can ensure these packages are installed by loading them as follows:

```{r}
library("microbenchmark")
library("profvis")
library("ggplot2")
library("readr")
```

The prerequisites needed to run the code contained in the entire book are covered in \@ref(book-resources) at the end of this chapter.
Expand Down Expand Up @@ -186,8 +187,10 @@ profvis(expr = {
library("ggplot2")

# Stage 2: load and process data
out = readRDS("extdata/out-ice.Rds")
df = dplyr::rbind_all(out, id = "Year")
extdata_path <-
"https://raw.githubusercontent.com/csgillespie/efficientR/master/extdata/"
out <- readr::read_rds(paste0(extdata_path, "out-ice.Rds"))
df <- dplyr::bind_rows(out, .id = "Year")

# Stage 3: visualise output
ggplot(df, aes(long, lat, group = paste(group, Year))) +
Expand Down