Skip to content

Instantly share code, notes, and snippets.

View kmasiello's full-sized avatar

Katie Masiello kmasiello

View GitHub Profile
@kmasiello
kmasiello / gist:c38e7cf0a03cd375d5b0a1004f37be50
Created February 23, 2024 01:46
`renv::restore()` output following `RENV_CONFIG_PAK_ENABLED=FALSE`
> renv::restore()
The following package(s) will be updated:
# GitHub ---------------------------------------------------------------------
- bikeHelpR [* -> sol-eng/bikeHelpR@main]
- connectapi [* -> rstudio/connectapi@HEAD]
- rsconnect [* -> rstudio/rsconnect@main]
# RSPM -----------------------------------------------------------------------
- class [7.3-22 -> 7.3-19]
@kmasiello
kmasiello / pin_compare
Last active December 21, 2022 23:18
Use `diffdf` to identify differences between two versions of a pinned data frame on Connect
## Also see pin_unique helper function at https://gist.github.com/kmasiello/2d47c88617339fa69c85fa3ed8905e86 to only pin if the data frame is changed from the previous version.
library(pins)
board <- board_rsconnect()
# Get version diffs
# Parameters for `pin_compare`
@kmasiello
kmasiello / pin_unique
Last active December 21, 2022 23:17
Only pin a data frame to Connect if it has changed
library(pins)
board <- board_rsconnect()
# Start with a reference pin
ref_pin <- mtcars
pin_write(board, ref_pin, description = "A pin that might change.")
# Make a changed data frame
mtcars2 <- mtcars %>% dplyr::mutate(cyl = cyl*2)