diff --git a/dev/articles/customize-pins-metadata.html b/dev/articles/customize-pins-metadata.html index 8cd65471..a84cb743 100644 --- a/dev/articles/customize-pins-metadata.html +++ b/dev/articles/customize-pins-metadata.html @@ -138,7 +138,7 @@
ten_letters <- factor(sample(letters, size = 10), levels = letters)
board %>% pin_write_factor_json(ten_letters, "letters-as-json")
-#> Creating new version '20240802T165216Z-099e2'
+#> Creating new version '20240802T172604Z-099e2'
#> Writing to pin 'letters-as-json'
Reading from the downloaded pin is straightforward;
pin_download()
returns a local path that can be piped to
arrow::read_feather()
:
pin_upload_arrow(board, x = mtcars, name = "mtcars-arrow2")
-#> Creating new version '20240802T165218Z-83900'
As before, you can pipe the result of pin_download()
to
your reader function:
diff --git a/dev/articles/pins-update.html b/dev/articles/pins-update.html index e8493161..410d7e5c 100644 --- a/dev/articles/pins-update.html +++ b/dev/articles/pins-update.html @@ -126,7 +126,7 @@Examples pin_write(board, head(mtcars), "mtcars") #> Guessing `type = 'rds'` -#> Creating new version '20240802T165221Z-f79b9' +#> Creating new version '20240802T172610Z-f79b9' #> Writing to pin 'mtcars' pin_read(board, "mtcars") #> mpg cyl disp hp drat wt qsec vs am gear carb @@ -165,7 +165,7 @@
Pinning filespin(path, "alphabet", board = "vignette") pin_get("alphabet", board = "vignette") -#> [1] "/tmp/Rtmp7fGDhI/file1ef061c089f4/alphabet/file1ef06efb0cf"
pins 1.0.0 clearly separates the two cases of pin an object and
pinning a file, so here instead of pin_write()
and
pin_read()
you need to pin_upload()
and
@@ -173,9 +173,9 @@
# Modern API
board %>% pin_upload(path, "alphabet")
-#> Creating new version '20240802T165222Z-ee580'
+#> Creating new version '20240802T172611Z-ee580'
board %>% pin_download("alphabet")
-#> [1] "~/.local/share/pins/alphabet/20240802T165222Z-ee580/file1ef06efb0cf"
+#> [1] "~/.local/share/pins/alphabet/20240802T172611Z-ee580/file1d781cb4d275"
This now needs to be made explicit with the new
board_url()
, and since this returns a path, not a file, you
need to use pin_download()
:
The first argument is the object to save (usually a data frame, but it can be any R object), and the second argument gives the “name” of the @@ -219,14 +219,14 @@
This shows you the metadata that’s generated by default. This includes:
While we’ll do our best to keep the automatically generated metadata
consistent over time, I’d recommend manually capturing anything you
really care about in metadata
.
You can list all the available versions with
pin_versions()
:
You can delete a specific older version with
pin_version_delete()
or sets of older versions with
pin_versions_prune()
.
board %>% pin_upload(paths, "example")
-#> Creating new version '20240802T165227Z-e9d42'
pin_download()
returns a vector of paths:
board %>% pin_download("example")
-#> [1] "/tmp/RtmpQ0fHE9/pins-1f3543e95741/example/20240802T165227Z-e9d42/mtcars.csv"
-#> [2] "/tmp/RtmpQ0fHE9/pins-1f3543e95741/example/20240802T165227Z-e9d42/alphabet.txt"
It’s now your job to handle them. You should treat these paths as internal implementation details — never modify them and never save them for use outside of pins.
@@ -377,7 +377,7 @@
board %>% pin_download("mtcars")
-#> [1] "/tmp/RtmpQ0fHE9/pins-1f3543e95741/mtcars/20240802T165225Z-f892e/mtcars.rds"
board %>% pin_write(mtcars, type = "json")
#> Using `name = 'mtcars'`
-#> Creating new version '20240802T165234Z-c2702'
+#> Creating new version '20240802T172622Z-c2702'
#> Writing to pin 'mtcars'
Let’s make a new version of this data by adding a column:
lper100km
, consumption in liters per 100 km. This could
@@ -139,7 +139,7 @@
Let’s check our board to ensure we have one pin named
"mtcars"
, with two versions:
Because a board_url()
is consumed over the web, it
doesn’t have access to a file system the way, for example, a
board_folder()
has; we can work around this by creating a
@@ -177,8 +177,8 @@
mtcars:
-- mtcars/20240802T165234Z-c2702/
-- mtcars/20240802T165236Z-8416c/
+- mtcars/20240802T172622Z-c2702/
+- mtcars/20240802T172625Z-8416c/
At this point, we would publish the folder containing the board as a
part of a web site. Let’s pretend that we have served the folder from
our fake website, https://not.real.website.co/pins/
.
We can read the most-recent version of the "mtcars"
pin:
diff --git a/dev/pkgdown.yml b/dev/pkgdown.yml index 0899e6cf..0d95b784 100644 --- a/dev/pkgdown.yml +++ b/dev/pkgdown.yml @@ -8,7 +8,7 @@ articles: pins: pins.html posit-connect: posit-connect.html using-board-url: using-board-url.html -last_built: 2024-08-02T16:51Z +last_built: 2024-08-02T17:25Z urls: reference: https://pins.rstudio.com/reference article: https://pins.rstudio.com/articles diff --git a/dev/reference/board_register.html b/dev/reference/board_register.html index 0e531a05..7f0bbc39 100644 --- a/dev/reference/board_register.html +++ b/dev/reference/board_register.html @@ -130,7 +130,7 @@Examplesboard %>% pin_write(mtcars) #> Using `name = 'mtcars'` #> Guessing `type = 'rds'` -#> Creating new version '20240802T165202Z-b9134' +#> Creating new version '20240802T172551Z-b9134' #> Writing to pin 'mtcars' board %>% pin_read("mtcars") #> mpg cyl disp hp drat wt qsec vs am gear carb diff --git a/dev/reference/legacy_local.html b/dev/reference/legacy_local.html index 55c87d79..f1c08273 100644 --- a/dev/reference/legacy_local.html +++ b/dev/reference/legacy_local.html @@ -127,7 +127,7 @@
Examplesboard <- board_local() board %>% pin_write(data.frame(x = 1:3), "test") #> Guessing `type = 'rds'` -#> Creating new version '20240802T165206Z-1422a' +#> Creating new version '20240802T172555Z-1422a' #> Writing to pin 'test' board %>% pin_read("test") #> x diff --git a/dev/reference/pin.html b/dev/reference/pin.html index 8b4da5bd..265a61f7 100644 --- a/dev/reference/pin.html +++ b/dev/reference/pin.html @@ -148,7 +148,7 @@
Examplesboard %>% pin_write(mtcars) #> Using `name = 'mtcars'` #> Guessing `type = 'rds'` -#> Creating new version '20240802T165206Z-b9134' +#> Creating new version '20240802T172555Z-b9134' #> Writing to pin 'mtcars' board %>% pin_read("mtcars") #> mpg cyl disp hp drat wt qsec vs am gear carb diff --git a/dev/reference/pin_browse.html b/dev/reference/pin_browse.html index 9160ee2d..f6f339b0 100644 --- a/dev/reference/pin_browse.html +++ b/dev/reference/pin_browse.html @@ -95,19 +95,19 @@
Examples
board <- board_temp(versioned = TRUE) board %>% pin_write(1:10, "x") #> Guessing `type = 'rds'` -#> Creating new version '20240802T165206Z-76a69' +#> Creating new version '20240802T172555Z-76a69' #> Writing to pin 'x' board %>% pin_write(1:11, "x") #> Guessing `type = 'rds'` -#> Creating new version '20240802T165207Z-8bb6c' +#> Creating new version '20240802T172555Z-8bb6c' #> Writing to pin 'x' board %>% pin_write(1:12, "x") #> Guessing `type = 'rds'` -#> Creating new version '20240802T165207Z-8e80a' +#> Creating new version '20240802T172555Z-8e80a' #> Writing to pin 'x' board %>% pin_browse("x", local = TRUE) -#> ℹ Pin at </tmp/RtmpBGSDd5/pins-18422b30a23e/x/20240802T165207Z-8e80a> +#> ℹ Pin at </tmp/RtmpECtVjC/pins-16cc61f3fd3c/x/20240802T172555Z-8e80a>