Week 9: Work week and presentations

EDS 411B Week 9:

Today:

Meet pins!

The pins package from RStudio lets you “publish data, models, and other R objects, making it easy to share them across projects and with your colleagues. You can pin objects to a variety of pin boards, including folders (to share on a networked drive or with services like DropBox), RStudio Connect, Amazon S3, Azure storage and Microsoft 365 (OneDrive and SharePoint). Pins can be automatically versioned, making it straightforward to track changes, re-run analyses on historical data, and undo mistakes”

I’m just going to show a very basic example of creating a pin board locally, adding some stuff to it, then accessing them from the board.

Set-up

Make a local board

For example, you can store a board as my_board.

Add something to it

Add a dataset to your board

Make the dataset:

cool_data <- tribble(
  ~teddy, ~khora,
  1, 2, 
  3, 4,
  5, 7
)

Add it to the board:

my_board %>% pin_write(cool_data, "cool_data", versioned = TRUE)

Read in something from your board

my_board %>% pin_read("cool_data")

See some metadata

my_board %>% pin_meta("cool_data")

Check the versions

my_board %>% pin_versions("cool_data")

Update the data, see new version!

Want to work with an older version?

Use the version ID.

my_board %>% pin_read("cool_data", version = "20220525T171008Z-476f6")

pins resources