pin_download: Upload and download files to and from a board

Description Usage Arguments Value Examples

View source: R/pin-upload-download.R

Description

This is a lower-level interface than pin_read() and pin_write() that you can use to pin any file, as opposed to any R object. The path returned by pin_download() is a read-only path to a cached file: you should never attempt to modify this file.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
pin_download(board, name, version = NULL, hash = NULL, ...)

pin_upload(
  board,
  paths,
  name = NULL,
  title = NULL,
  description = NULL,
  metadata = 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.

hash

Specify a hash to verify that you get exactly the dataset that you expect. You can find the hash of an existing pin by looking for pin_hash in pin_meta().

...

Additional arguments passed on to methods for a specific board.

paths

A character vector of file paths to upload to board.

title

A title for the pin; most important for shared boards so that others can understand what the pin contains. If omitted, a brief description of the contents will be automatically generated.

description

A detailed description of the pin contents.

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.

Value

pin_download() returns a character vector of file paths; pin_upload() returns the fully qualified name of the new pin, invisibly.

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.