Pin metadata comes from three sources:

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

    • $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

    • $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.

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

Arguments

board

A pin board, created by board_folder(), board_rsconnect(), board_url() or other other 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))
#> Guessing `type = 'rds'`
#> Creating new version '20211004T114928Z-3e025'
#> Writing to pin 'mtcars'

# Get the pin
b %>% pin_read("mtcars")
#>                    mpg cyl disp  hp drat    wt  qsec vs am gear carb
#> Mazda RX4         21.0   6  160 110 3.90 2.620 16.46  0  1    4    4
#> Mazda RX4 Wag     21.0   6  160 110 3.90 2.875 17.02  0  1    4    4
#> Datsun 710        22.8   4  108  93 3.85 2.320 18.61  1  1    4    1
#> Hornet 4 Drive    21.4   6  258 110 3.08 3.215 19.44  1  0    3    1
#> Hornet Sportabout 18.7   8  360 175 3.15 3.440 17.02  0  0    3    2
#> Valiant           18.1   6  225 105 2.76 3.460 20.22  1  0    3    1
# Get its metadata
b %>% pin_meta("mtcars")
#> List of 10
#>  $ file       : chr "mtcars.rds"
#>  $ file_size  : 'fs_bytes' int 425
#>  $ pin_hash   : chr "3e0253462eb15a44"
#>  $ type       : chr "rds"
#>  $ title      : chr "mtcars: a pinned 6 x 11 data frame"
#>  $ description: NULL
#>  $ created    : POSIXct[1:1], format: "2021-10-04 11:49:00"
#>  $ api_version: num 1
#>  $ user       :List of 1
#>   ..$ Hadley: logi TRUE
#>  $ local      :List of 3
#>   ..$ dir    : 'fs_path' chr "/tmp/RtmpOFHnBR/pins-346b6e3e1867/mtcars/20211004T114928Z-3e025"
#>   ..$ url    : NULL
#>   ..$ version: chr "20211004T114928Z-3e025"
# Get path to underlying data
b %>% pin_download("mtcars")
#> [1] "/tmp/RtmpOFHnBR/pins-346b6e3e1867/mtcars/20211004T114928Z-3e025/mtcars.rds"