knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

quickdraw

The quickdraw package allows you to download and retrieve the dataset categories from the quickdraw dataset:

Installation

You can install the released version of quickdraw from CRAN with:

install.packages("quickdraw")

And the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("huizezhang-sherry/quickdraw")

Data Retrieval

Data files are cached and retrieved using the qd_read function:

library(quickdraw)

octopus <- qd_read("octopus")
octopus

The last column is a nested list which is a drawing made, it consists of the x,y coordinates for each stroke:

You will have to properly install the R package cloudml and a command line tool, gsutil, for qd_read() to read data properly from Google Cloud Storage. To install gsutil, type cloudml::gcloud_install() in the console and follow the instructions.

You can draw a pic with qd_tidy and qd_draw

octopus %>% 
  qd_tidy(10) %>% 
  qd_draw()

You could also animate multiple drawings with qd_draw

octopus %>% 
  qd_tidy(sample.int(nrow(octopus), 6)) %>% 
  qd_draw(animate = TRUE)


huizezhang-sherry/quickdraw documentation built on July 17, 2020, 8:40 a.m.