pin_meta: Retrieve metadata for a pin

View source: R/pin-meta.R

pin_metaR Documentation

Retrieve metadata for a pin

Description

Pin metadata comes from three sources:

  • Standard metadata added by pin_upload()/pin_write(). This includes:

    • ⁠$name⁠ - the pin's name.

    • ⁠$file⁠ - names of files stored in the pin.

    • ⁠$file_size⁠ - size of each file.

    • ⁠$pin_hash⁠ - hash of pin contents.

    • ⁠$type⁠ - type of pin: "rds", "csv", etc

    • ⁠$title⁠ - pin title

    • ⁠$description⁠ - pin description

    • ⁠$tags⁠ - pin tags

    • ⁠$urls⁠ - URLs for more info on pin

    • ⁠$created⁠ - date this (version of the pin) was created

    • ⁠$api_version⁠ - API version used by pin

  • Metadata supplied by the user, stored in ⁠$user⁠. This is untouched from what is supplied in pin_write()/pin_upload() except for being converted to and from to YAML.

  • Local metadata generated when caching the pin, stored in ⁠$local⁠. This includes information like the version of the pin, and the path its local cache.

Usage

pin_meta(board, name, version = NULL, ...)

Arguments

board

A pin board, created by board_folder(), board_connect(), board_url() or another board_ function.

name

Pin name.

version

Retrieve a specific version of a pin. Use pin_versions() to find out which versions are available and when they were created.

...

Additional arguments passed on to methods for a specific board.

Value

A list.

Examples

b <- board_temp()
b %>% pin_write(head(mtcars), "mtcars", metadata = list("Hadley" = TRUE))

# Get the pin
b %>% pin_read("mtcars")
# Get its metadata
b %>% pin_meta("mtcars")
# Get path to underlying data
b %>% pin_download("mtcars")

# Use tags instead
b %>% pin_write(tail(mtcars), "mtcars", tags = c("fuel-efficiency", "automotive"))
b %>% pin_meta("mtcars")


pins documentation built on Oct. 7, 2024, 5:07 p.m.