pin_fetch: Fetch/store a pin

Description Usage Arguments Value Examples

View source: R/pin-store-fetch.R

Description

These are low-level functions that power pin_read(), pin_write(), pin_upload(), and pin_download. They are needed primarily for folks developing new board types, and should not generally be called directly.

Usage

1
2
3
pin_fetch(board, name, version = NULL, ...)

pin_store(board, name, paths, metadata, versioned = NULL, x = 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.

paths

A character vector of file paths to upload to board.

metadata

A list containing additional metadata to store with the pin. When retrieving the pin, this will be stored in the user key, to avoid potential clashes with the metadata that pins itself uses.

versioned

Should the pin be versioned? The default, NULL, will use the default for board

x

An object (typically a data frame) to pin.

Value

pin_fetch() is called primarily for its side-effect of downloading remote pins into the local cache. It returns the same data as pin_meta. pin_store() is called for its side-effect of uploading a local file to a remote board. It invisibly returns the fully qualified pin name.

Examples

1
2
3
4
5
6
board <- board_temp()

board %>% pin_upload(system.file("CITATION"))
path <- board %>% pin_download("CITATION")
path
readLines(path)[1:5]

pins documentation built on Oct. 2, 2021, 5:06 p.m.