diff --git a/dev/apple-touch-icon-120x120.png b/dev/apple-touch-icon-120x120.png index 59310e03..0515cc51 100644 Binary files a/dev/apple-touch-icon-120x120.png and b/dev/apple-touch-icon-120x120.png differ diff --git a/dev/apple-touch-icon-152x152.png b/dev/apple-touch-icon-152x152.png index e0149862..b923d50e 100644 Binary files a/dev/apple-touch-icon-152x152.png and b/dev/apple-touch-icon-152x152.png differ diff --git a/dev/apple-touch-icon-180x180.png b/dev/apple-touch-icon-180x180.png index d42d4d0f..2d73c8fb 100644 Binary files a/dev/apple-touch-icon-180x180.png and b/dev/apple-touch-icon-180x180.png differ diff --git a/dev/apple-touch-icon-60x60.png b/dev/apple-touch-icon-60x60.png index 39c0014f..3c0a09b3 100644 Binary files a/dev/apple-touch-icon-60x60.png and b/dev/apple-touch-icon-60x60.png differ diff --git a/dev/apple-touch-icon-76x76.png b/dev/apple-touch-icon-76x76.png index df982d57..fcb826b7 100644 Binary files a/dev/apple-touch-icon-76x76.png and b/dev/apple-touch-icon-76x76.png differ diff --git a/dev/apple-touch-icon.png b/dev/apple-touch-icon.png index c3ecff4a..f9b09df0 100644 Binary files a/dev/apple-touch-icon.png and b/dev/apple-touch-icon.png differ diff --git a/dev/articles/customize-pins-metadata.html b/dev/articles/customize-pins-metadata.html index 65fd3ba1..838a458f 100644 --- a/dev/articles/customize-pins-metadata.html +++ b/dev/articles/customize-pins-metadata.html @@ -160,7 +160,7 @@
ten_letters <- factor(sample(letters, size = 10), levels = letters)
board %>% pin_write_factor_json(ten_letters, "letters-as-json")
-#> Creating new version '20231005T012634Z-dfe35'
+#> Creating new version '20231019T173317Z-1b599'
#> Writing to pin 'letters-as-json'
Instead, we can also write a special function for reading, to reconstruct the factor including its levels:
@@ -181,7 +181,7 @@A function to read factors} board %>% pin_read_factor_json("letters-as-json") -#> [1] f i a g l h m j u w +#> [1] w g b a o d f j c k #> Levels: a b c d e f g h i j k l m n o p q r s t u v w x y z
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 '20231005T012639Z-be312'
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 f999c334..a3acf325 100644 --- a/dev/articles/pins-update.html +++ b/dev/articles/pins-update.html @@ -148,7 +148,7 @@Examples pin_write(board, head(mtcars), "mtcars") #> Guessing `type = 'rds'` -#> Creating new version '20231005T012644Z-8df40' +#> Creating new version '20231019T173326Z-8df40' #> Writing to pin 'mtcars' pin_read(board, "mtcars") #> mpg cyl disp hp drat wt qsec vs am gear carb @@ -187,7 +187,7 @@
Pinning filespin(path, "alphabet", board = "vignette") pin_get("alphabet", board = "vignette") -#> [1] "/tmp/Rtmp4r2MQ1/file21022c7ba03a/alphabet/file2102252f359d"
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
@@ -195,9 +195,9 @@
# Modern API
board %>% pin_upload(path, "alphabet")
-#> Creating new version '20231005T012646Z-ee580'
+#> Creating new version '20231019T173328Z-ee580'
board %>% pin_download("alphabet")
-#> [1] "~/.local/share/pins/alphabet/20231005T012646Z-ee580/file2102252f359d"
+#> [1] "~/.local/share/pins/alphabet/20231019T173328Z-ee580/file213a11b73ef1"
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 @@ -217,7 +217,7 @@
board %>% pin_meta("mtcars")
-#> List of 12
+#> List of 13
#> $ file : chr "mtcars.rds"
#> $ file_size : 'fs_bytes' int 900
#> $ pin_hash : chr "66c17690da0cee83"
@@ -225,14 +225,15 @@ Metadata#> $ title : chr "mtcars: a pinned 32 x 11 data frame"
#> $ description: NULL
#> $ tags : NULL
-#> $ created : POSIXct[1:1], format: "2023-10-05 01:26:50"
+#> $ urls : NULL
+#> $ created : POSIXct[1:1], format: "2023-10-19 17:33:32"
#> $ api_version: int 1
#> $ user : list()
#> $ name : chr "mtcars"
#> $ local :List of 3
-#> ..$ dir : 'fs_path' chr "/tmp/RtmpgIEpJc/pins-214f2bb940be/mtcars/20231005T012650Z-66c17"
+#> ..$ dir : 'fs_path' chr "/tmp/RtmpgNKgRg/pins-21867f5c2dab/mtcars/20231019T173332Z-66c17"
#> ..$ url : NULL
-#> ..$ version: chr "20231005T012650Z-66c17"
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 '20231005T012653Z-e9d42'
pin_download()
returns a vector of paths:
board %>% pin_download("example")
-#> [1] "/tmp/RtmpgIEpJc/pins-214f2bb940be/example/20231005T012653Z-e9d42/mtcars.csv"
-#> [2] "/tmp/RtmpgIEpJc/pins-214f2bb940be/example/20231005T012653Z-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.
@@ -380,7 +382,7 @@
board %>% pin_download("mtcars")
-#> [1] "/tmp/RtmpgIEpJc/pins-214f2bb940be/mtcars/20231005T012650Z-66c17/mtcars.rds"
board %>% pin_write(mtcars, type = "json")
#> Using `name = 'mtcars'`
-#> Creating new version '20231005T012707Z-c2702'
+#> Creating new version '20231019T173346Z-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
@@ -161,7 +161,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
@@ -199,8 +199,8 @@
mtcars:
-- mtcars/20231005T012707Z-c2702/
-- mtcars/20231005T012709Z-8416c/
+- mtcars/20231019T173346Z-c2702/
+- mtcars/20231019T173348Z-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:
@@ -274,10 +274,10 @@pkgdown
The R Packages book suggests using a folder called
data-raw
for working with datasets; this can be adapted to -use pins. You would start withusethis::use_data_raw()
. In +use pins. You would start withusethis::use_data_raw()
. In a file in your/data-raw
directory, wrangle and clean your datasets in the same way as if you were going to use -usethis::use_data()
. To offer such datasets on a web-based +usethis::use_data()
. To offer such datasets on a web-based board instead of as a built-in package dataset, in your/data-raw
file you would:diff --git a/dev/favicon-16x16.png b/dev/favicon-16x16.png index 6a8da03b..eedae3ba 100644 Binary files a/dev/favicon-16x16.png and b/dev/favicon-16x16.png differ diff --git a/dev/favicon-32x32.png b/dev/favicon-32x32.png index da68cb47..21c8d252 100644 Binary files a/dev/favicon-32x32.png and b/dev/favicon-32x32.png differ diff --git a/dev/pkgdown.yml b/dev/pkgdown.yml index 57fee869..22fb5d23 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: 2023-10-05T01:25Z +last_built: 2023-10-19T17:32Z 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 25665806..f11b9026 100644 --- a/dev/reference/board_register.html +++ b/dev/reference/board_register.html @@ -147,7 +147,7 @@
Examplesboard %>% pin_write(mtcars) #> Using `name = 'mtcars'` #> Guessing `type = 'rds'` -#> Creating new version '20231005T012611Z-64844' +#> Creating new version '20231019T173254Z-64844' #> 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 3b759210..858b21fc 100644 --- a/dev/reference/legacy_local.html +++ b/dev/reference/legacy_local.html @@ -142,7 +142,7 @@
Examplesboard <- board_local() board %>% pin_write(data.frame(x = 1:3), "test") #> Guessing `type = 'rds'` -#> Creating new version '20231005T012617Z-59306' +#> Creating new version '20231019T173300Z-59306' #> Writing to pin 'test' board %>% pin_read("test") #> x diff --git a/dev/reference/pin.html b/dev/reference/pin.html index ebadb48c..9c8b9356 100644 --- a/dev/reference/pin.html +++ b/dev/reference/pin.html @@ -163,7 +163,7 @@
Examplesboard %>% pin_write(mtcars) #> Using `name = 'mtcars'` #> Guessing `type = 'rds'` -#> Creating new version '20231005T012618Z-64844' +#> Creating new version '20231019T173301Z-64844' #> 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 5cdb0914..23639e4b 100644 --- a/dev/reference/pin_browse.html +++ b/dev/reference/pin_browse.html @@ -110,19 +110,19 @@
Examples
board <- board_temp(versioned = TRUE) board %>% pin_write(1:10, "x") #> Guessing `type = 'rds'` -#> Creating new version '20231005T012619Z-1d13c' +#> Creating new version '20231019T173302Z-1d13c' #> Writing to pin 'x' board %>% pin_write(1:11, "x") #> Guessing `type = 'rds'` -#> Creating new version '20231005T012619Z-661c8' +#> Creating new version '20231019T173302Z-661c8' #> Writing to pin 'x' board %>% pin_write(1:12, "x") #> Guessing `type = 'rds'` -#> Creating new version '20231005T012619Z-c9eb6' +#> Creating new version '20231019T173302Z-c9eb6' #> Writing to pin 'x' board %>% pin_browse("x", local = TRUE) -#> ℹ Pin at </tmp/RtmpBMWHb9/pins-18f96999c434/x/20231005T012619Z-c9eb6> +#> ℹ Pin at </tmp/Rtmpyz8J8k/pins-193146acc60a/x/20231019T173302Z-c9eb6>
b <- board_temp()
b %>% pin_write(head(mtcars), "mtcars", metadata = list("Hadley" = TRUE))
#> Guessing `type = 'rds'`
-#> Creating new version '20231005T012625Z-8df40'
+#> Creating new version '20231019T173308Z-8df40'
#> Writing to pin 'mtcars'
# Get the pin
@@ -182,7 +185,7 @@ Examples#> 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 12
+#> List of 13
#> $ file : chr "mtcars.rds"
#> $ file_size : 'fs_bytes' int 425
#> $ pin_hash : chr "8df403c9bfd86c78"
@@ -190,26 +193,27 @@ Examples#> $ title : chr "mtcars: a pinned 6 x 11 data frame"
#> $ description: NULL
#> $ tags : NULL
-#> $ created : POSIXct[1:1], format: "2023-10-05 01:26:25"
+#> $ urls : NULL
+#> $ created : POSIXct[1:1], format: "2023-10-19 17:33:08"
#> $ api_version: int 1
#> $ user :List of 1
#> ..$ Hadley: logi TRUE
#> $ name : chr "mtcars"
#> $ local :List of 3
-#> ..$ dir : 'fs_path' chr "/tmp/RtmpBMWHb9/pins-18f91d413100/mtcars/20231005T012625Z-8df40"
+#> ..$ dir : 'fs_path' chr "/tmp/Rtmpyz8J8k/pins-1931ddd4455/mtcars/20231019T173308Z-8df40"
#> ..$ url : NULL
-#> ..$ version: chr "20231005T012625Z-8df40"
+#> ..$ version: chr "20231019T173308Z-8df40"
# Get path to underlying data
b %>% pin_download("mtcars")
-#> [1] "/tmp/RtmpBMWHb9/pins-18f91d413100/mtcars/20231005T012625Z-8df40/mtcars.rds"
+#> [1] "/tmp/Rtmpyz8J8k/pins-1931ddd4455/mtcars/20231019T173308Z-8df40/mtcars.rds"
# Use tags instead
b %>% pin_write(tail(mtcars), "mtcars", tags = c("fuel-efficiency", "automotive"))
#> Guessing `type = 'rds'`
-#> Replacing version '20231005T012625Z-8df40' with '20231005T012625Z-acdff'
+#> Replacing version '20231019T173308Z-8df40' with '20231019T173308Z-acdff'
#> Writing to pin 'mtcars'
b %>% pin_meta("mtcars")
-#> List of 12
+#> List of 13
#> $ file : chr "mtcars.rds"
#> $ file_size : 'fs_bytes' int 465
#> $ pin_hash : chr "acdff317b06bb19c"
@@ -217,14 +221,15 @@ Examples#> $ title : chr "mtcars: a pinned 6 x 11 data frame"
#> $ description: NULL
#> $ tags : chr [1:2] "fuel-efficiency" "automotive"
-#> $ created : POSIXct[1:1], format: "2023-10-05 01:26:25"
+#> $ urls : NULL
+#> $ created : POSIXct[1:1], format: "2023-10-19 17:33:08"
#> $ api_version: int 1
#> $ user : list()
#> $ name : chr "mtcars"
#> $ local :List of 3
-#> ..$ dir : 'fs_path' chr "/tmp/RtmpBMWHb9/pins-18f91d413100/mtcars/20231005T012625Z-acdff"
+#> ..$ dir : 'fs_path' chr "/tmp/Rtmpyz8J8k/pins-1931ddd4455/mtcars/20231019T173308Z-acdff"
#> ..$ url : NULL
-#> ..$ version: chr "20231005T012625Z-acdff"
+#> ..$ version: chr "20231019T173308Z-acdff"
diff --git a/dev/reference/pin_read.html b/dev/reference/pin_read.html
index 99f26b95..6f082c8e 100644
--- a/dev/reference/pin_read.html
+++ b/dev/reference/pin_read.html
@@ -93,6 +93,7 @@