Skip to contents

This function attempts to retrieve a specified pin from a board. If the pin doesn't exist or the data is different, it creates a new pin.

Usage

pin_get_or_create(.data, .board, .name, type = "csv", ...)

Arguments

.data

The data to be pinned if a new pin is to be created.

.board

The board where the pin is located or should be created.

.name

The name of the pin to be retrieved or created.

type

The type of data being pinned, defaults to 'csv'.

...

Additional arguments to be passed to pins::pin_write.

Value

The version of the pin that was retrieved or created.

Examples

if (FALSE) {
  board <- pins::board_register_local()
  data <- mtcars
  pin_version <- pin_get_or_create(data, board, "mtcars_pin")
}