This meetup is structured as a mini-workshop. You learn about three tools you can combine to improve the way you manage data: Azure, RStudio server and the pins package. As a side effect you will also learn a system we plan to use in a longer workshop.
Find materials are at https://github.com/2DegreesInvesting/ds-incubator/issues/45; the most important document to follow along is https://bit.ly/dsi-pin-azure.
Open 00_intro-rmd.Rmd
The goal of this section is to practice the tools we'll be using later:
Managing these three things at once is hard and will likely distract you from learning anything. A little practice will help you will master these tools so you can focus on the content of the lessons to come.
This is an R Markdown Notebook. When you execute code within the notebook, the results appear beneath the code.
R code goes in code chunks, denoted by three backticks. Try executing this chunk by clicking the Run button within the chunk or by placing your cursor inside it and pressing Crtl+Shift+Enter (Windows) or Cmd+Shift+Enter (Mac).
packageVersion("pins")
Open 01_setup-azure-board.Rmd
usethis::edit_r_environ()
.AZURE_STORAGE_CONTAINER="test-container"
AZURE_STORAGE_ACCOUNT="2diiteststorage"
# Not my real key
AZURE_STORAGE_KEY="ABABAB...=="
?usethis::edit_r_environ()
.Open 02_use-azure-board.Rmd
library(pins)
.board_register_azure()
library(pins)
board_register_azure()
pin_find()
, by name or description.pin_find("mtc", board = "azure")
mtcars
dataset from our Azure board with pin_get()
.mydata
.mydata <- pin_get("mtcars", board = "azure")
mydata
head()
of mydata
and assign it to a new object smalldata
.smalldata <- head(mydata)
smalldata
smalldata
in you local (server) cache with pin()
pin(smalldata)
pin_find("smalldata")
pin_get("smalldata")
server_cache <- board_cache_path()
server_cache
fs::dir_tree(server_cache)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.