- 3 Minutes Wednesdays
- Posts
- 3MW (Using {pins} for data storage)
3MW (Using {pins} for data storage)
Enjoy 3 Minute Wednesdays at no cost.
This newsletter is brought to you for free. If you want to advance your R skills and support my work at the same time, then you will like my paid offerings:
Guten Tag!
Many greetings from Munich, Germany. In today’s newsletter, we are talking about the {pins}
package. This package is not very well known in the R sphere, but it is a fantastic tool for keeping track of different data versions.
Basically, {pins}
makes storing data and versioning dead-simple. You can think of it as Git for your data. But before we dive in, I have a short thing to ask you: ‘
What‘s next?
Recently, I find myself covering more and more technical aspects of data science that are not necessarily R focused. This includes:
Building automations with GitHub Actions
Setting up infrastructure on AWS or Azure
Using JavaScript to handle AI responses in Shiny apps
I do this because I think data science doesn’t happen in any single tool or language. Thus, I want to continue writing in as broad a scope as I feel like at the moment (after all I get to do whatever I want on this newsletter 🤪)
But I do want to see if I can make this as valuable for you as possible. So let me know what you’re interested in by filling out this small poll.
Just click on your favorite choice and it will be recorded. After that, you’ll also have the chance to leave additional comments in case you want to suggest something I haven’t thought of.
What would you like to see on this newsletter? |
Why use the {pins}
package?
Now, before I show you how {pins}
works, let’s talk about why you should even use it
Version control: Prevents accidental overwriting of important datasets when re-running workflows.
Efficient workflows: You can run a calculation or an API call once and store the data permanently in a pin.
Metadata storage:
{pins}
keeps detailed information about your data so you can easily restore or revert to previous versions.Seamless integration : You can store data anywhere you like. GitHub, Google Drive, AWS S3, you name it.
{pins}
will work exactly the same.
Surely, you’re wondering how all of that is supposed to work. So let’s dive into the technical details.
Set up {pins}
First, you need to install the package. As always, you can do this with:

Set up a board
To store data, you need to place “pins” in a “board”. If you want to try {pins}
locally first, create a board using:

Write data to a pin
To write data to your board, simply use:

This creates a new pin, and the best part is that previous data versions aren’t deleted.
Retrieving a specific version
To check how many data versions exist in your board, use:

That’s currently pretty boring. So let’s modify our data and overwrite our pin multiple times.

Now, check out the different versions:

Once you decide which version you want to load, retrieve it using:

As you can see, setting up {pins}
is simple and efficient for storing and retrieving data. And the best thing is that you cannot accidentally overwrite data. Next week, I’ll show you how to set up cloud storages for your pins.
As always, if you have any questions, or just want to reach out, feel free to contact me by replying to this mail or finding me on LinkedIn or on Bluesky.
See you next week,
Albert 👋
Enjoyed this newsletter? Here are other ways I can help you:
Reply