diff --git a/dev/articles/customize-pins-metadata.html b/dev/articles/customize-pins-metadata.html index 1e8cbb10..3185bfab 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 '20241213T221813Z-099e2'
+#> Creating new version '20241213T233106Z-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 '20241213T221815Z-a863e'
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 2de6607d..7542c0b5 100644 --- a/dev/articles/pins-update.html +++ b/dev/articles/pins-update.html @@ -140,7 +140,7 @@Examples pin_write(board, head(mtcars), "mtcars") #> Guessing `type = 'rds'` -#> Creating new version '20241213T221819Z-fe62f' +#> Creating new version '20241213T233113Z-fe62f' #> Writing to pin 'mtcars' pin_read(board, "mtcars") #> mpg cyl disp hp drat wt qsec vs am gear carb @@ -179,7 +179,7 @@
Pinning filespin(path, "alphabet", board = "vignette") pin_get("alphabet", board = "vignette") -#> [1] "/tmp/RtmpqVP5iU/file1d327e66ee78/alphabet/file1d32294d330e"
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
@@ -187,9 +187,9 @@
# Modern API
board %>% pin_upload(path, "alphabet")
-#> Creating new version '20241213T221820Z-ee580'
+#> Creating new version '20241213T233114Z-ee580'
board %>% pin_download("alphabet")
-#> [1] "~/.local/share/pins/alphabet/20241213T221820Z-ee580/file1d32294d330e"
+#> [1] "~/.local/share/pins/alphabet/20241213T233114Z-ee580/file1d8b4c74cfa5"
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 '20241213T221824Z-e9d42'
pin_download()
returns a vector of paths:
board %>% pin_download("example")
-#> [1] "/tmp/RtmptcluLr/pins-1d78e900bc0/example/20241213T221824Z-e9d42/mtcars.csv"
-#> [2] "/tmp/RtmptcluLr/pins-1d78e900bc0/example/20241213T221824Z-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/RtmptcluLr/pins-1d78e900bc0/mtcars/20241213T221822Z-e5d8a/mtcars.rds"
board %>% pin_write(mtcars, type = "json")
#> Using `name = 'mtcars'`
-#> Creating new version '20241213T221833Z-c2702'
+#> Creating new version '20241213T233126Z-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/20241213T221833Z-c2702/
-- mtcars/20241213T221835Z-8416c/
+- mtcars/20241213T233126Z-c2702/
+- mtcars/20241213T233129Z-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/news/index.html b/dev/news/index.html index 86cfaa40..0009626e 100644 --- a/dev/news/index.html +++ b/dev/news/index.html @@ -57,6 +57,7 @@pins (development version)
Support new preview_data
parameter for pin previews on Posit Connect (#850).
Fixed a bug in how pin_upload()
handles pin names (#852).
Improved documentation for S3-compatible object storage (#853).
CRAN release: 2024-10-07
diff --git a/dev/pkgdown.yml b/dev/pkgdown.yml index e8fd0164..e3db4b8b 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-12-13T22:17Z +last_built: 2024-12-13T23:30Z 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 9c469054..2fc427ff 100644 --- a/dev/reference/board_register.html +++ b/dev/reference/board_register.html @@ -139,7 +139,7 @@Pin data to an S3 bucket, such as on Amazon's S3 service or MinIO, using the -paws.storage package.
+Pin data to an S3-compatible storage bucket, such as on Amazon's S3 service, +MinIO, or Digital Ocean, using the paws.storage package.
Endpoint to use; usually generated automatically for AWS
-from region
. For MinIO, use the full URL (including scheme like
-https://
) of your MinIO endpoint.
region
. For MinIO and Digital Ocean, use the full URL (including
+scheme like https://
) of your S3-compatible storage endpoint.
You can pass arguments for paws.storage::s3_put_object such as Tagging
and ServerSideEncryption
through the dots of pin_write()
. (Note that
these are separate from pin_write()
arguments like tags
.)
You can use board_s3()
with S3-compatible object storage on non-AWS
+platforms such as MinIO and Digital Ocean. For this type of object storage,
+use the full URL (including scheme like https://
) of the storage endpoint.
board_s3()
is powered by the paws.storage package, which is a
suggested dependency of pins (not required for pins in general). If
you run into errors when deploying content to a server like
diff --git a/dev/reference/legacy_local.html b/dev/reference/legacy_local.html
index cb5f4dce..d5e7a080 100644
--- a/dev/reference/legacy_local.html
+++ b/dev/reference/legacy_local.html
@@ -130,7 +130,7 @@
board <- board_temp(versioned = TRUE)
board %>% pin_write(1:10, "x")
#> Guessing `type = 'rds'`
-#> Creating new version '20241213T221803Z-eadc7'
+#> Creating new version '20241213T233057Z-eadc7'
#> Writing to pin 'x'
board %>% pin_write(1:11, "x")
#> Guessing `type = 'rds'`
-#> Creating new version '20241213T221803Z-9f7ea'
+#> Creating new version '20241213T233057Z-9f7ea'
#> Writing to pin 'x'
board %>% pin_write(1:12, "x")
#> Guessing `type = 'rds'`
-#> Creating new version '20241213T221803Z-034f5'
+#> Creating new version '20241213T233057Z-034f5'
#> Writing to pin 'x'
board %>% pin_browse("x", local = TRUE)
-#> ℹ Pin at </tmp/RtmpuqFOxt/pins-16873453152e/x/20241213T221803Z-eadc7>
+#> ℹ Pin at </tmp/RtmpiLapIv/pins-16dd704b5152/x/20241213T233057Z-eadc7>