Announcing pins 1.1.0

We're excited to announce that pins 1.1.0 for R is now available on CRAN! You can pin objects to a variety of pin boards, including Google Cloud Storage.
2023-01-26
The pins package hex sticker on a blurry hex wall.

I’m delighted to announce that pins 1.1.0 for R is now available on CRAN. The pins package publishes 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), Posit Connect, Amazon S3, Azure blob storage, and as of this new release, Google Cloud Storage! Pins can be versioned, making it straightforward to track changes, re-run analyses on historical data, and undo mistakes.

 

You can install pins with:

 

install.packages("pins")

 

About 18 months ago, we released pins 1.0.0 with a major overhaul of the user interface for the package. We continue to build on this new interface as our community uses pins in more complex ways on both our own professional tools and other platforms as well.

 

This post highlights several important improvements we want to make sure you know about.

 

To see all the changes in pins 1.1.0, including a few minor breaking changes, check out the release notes.

 

Support for Google Cloud Storage

 

After the release of pins 1.0.0, one of the features most requested by the community was support for using pins on Google Cloud Storage. This is now available in pins 1.1.0!

 

library(pins)
board <- board_gcs("pins-testing")
board %>% pin_write(1:10, "nice-numbers", type = "json")

 

#> Creating new version '20230123T190421Z-c3943'
#> Writing to pin 'nice-numbers'

 

Like board_s3() for AWS S3 and board_azure() for Azure blob storage, this allows you to both write to and read from an existing bucket that you have access to. Together with pins for Python, which we announced last year, this means that you can read and write on any of the AWS, Microsoft, or Google platforms in either R or Python. To read the pin we just wrote from R, I can use Python:

 

import pins

board = pins.board_gcs("pins-testing")
board.pin_read("nice-numbers")

 

#> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

 

You can use pins for multilingual data science and R/Python interoperability!

 

Reading from boards on the web

 

The pins package has had support for board_url() for a long time, but we have realized that it didn’t always work how users wanted or expected. This new release adds support for you as a publisher in creating a manifest file to go along with your board so that your collaborators can consume pins from the board in a more straightforward way.

 

Take a look at our new vignette on how to set up board_url() for easy collaboration, and many thanks to Ian Lyttle for contributing both the vignette and many of the ideas behind this new functionality. Ian has also created a small R package demonstrating how to share a dataset via pins directly from your pkgdown site using the new board_url(). Check it out!

 

Improvements for Posit Connect

 

Many users of our professional publishing platform Posit Connect take advantage of pins to share data and models. Several changes in this release focus on making the experience of these users better.

 

When you use Connect, the pins package keeps track of how to identify specific pieces of content and Connect users in a cache. If you’re familiar with caching, you probably know the saying attributed to Phil Karlton:

There are only two hard things in computer science: cache invalidation and naming things.

The previous incarnation of the content and user caches, unfortunately, demonstrated how hard this really can be, and our Connect customers sometimes experienced their caches getting into a bad state when the situation on the server changed. In this release, we changed the cache approach from using files on disk to an environment in R, so caches no longer persist between sessions. What this means for you is that these caches will be much less likely to end up in a broken state, and you can fix any cache problems by restarting R. It also means that in a new session, pins will need to look up some of these relationships between content and users.

 

This release also improved the pins code preview on Connect and updated the function for creating a board for Connect to board_connect(), following our rebranding from RStudio to Posit.

 

Acknowledgments

 

We’d like to thank all 66 folks who have contributed to pins since the 1.0.0 release, whether via filing issues or contributing code or documentation:

@9Rahulsharma, @afshinmhCLG, @akgold, @AkthemRehab, @atusy, @augustohassel, @AYu1804, @biggiemikkie, @bjfletcher, @christian-million, @chrisumphlett, @cl00wny, @cnemarich, @colearendt, @daattali, @dewoller, @duju211, @edavidaja, @erwinlares, @fh-mthomson, @FMKerckhof, @gardiners, @guzu92, @hadley, @harell, @hongooi73, @ijlyttle, @IndrajeetPatil, @innir, @jameshunterbr, @joelgsponer, @jonthegeek, @juliasilge, @justinmillar, @kmasiello, @laurejo1, @machow, @maglet, @mattwarkentin, @michkam89, @minimenchmuncher, @MislavSag, @oguchihy, @ojziff, @raisin-toast, @ramiromagno, @rjake, @rmccombie, @Sade154, @SaJaToGu, @salim-b, @samterfa, @scherbakovdmitri, @schmalte04, @sellorm, @slodge, @slohr, @taiyanl, @thomaszwagerman, @tomasjanikds, @tomsing1, @TylerGrantSmith, @vdamico, @vgXhc, @wurli, and @yacaslimi.