Skip to main content

Pretty Good Hat

Having seen how easy it was to convert a couple of hobby projects to use {pins}, I’m now daydreaming about putting it at the center of an S3 data lake operation.

I successfully made some small changes in a Shiny app to use the {pins} package to separate out a support file and data definitions from the app bundle itself. This lets me revise supporting information without needing to republish the app. It’s pretty cool! I’m excited to use the package lots more.

A partially completed puzzle with many neatly arranged pieces placed beside it

Having placed every puzzle piece with the slightest identifiable feature, we are left with a sea of blue, and we are positively laying siege to the remainder.

Sharing a quick tip that I’ve found useful while building with Shiny, recently: It’s handy to be able to save off the current state of a data set for bringing over to a scratch file. I made the download link appear only when running in my local environment. This way I can easily snapshot my in process data set for experimenting with visualization in my scratch file.

In ui.R:

    if(interactive()) {
      downloadLink("downloadData", "💾️ Download data set") 
    }

And in server.R:

    output$downloadData <- downloadHandler(
      filename = function() {
        paste("shiny-export_", Sys.Date(), ".csv", sep="")
      },
      content = function(file) {
        write.csv(globaldata$armor, file)
      }
    )

A TV in a dark room showing a video game character standing on a high platform overlooking a valley

🎮 Now that I’ve finished Citizen Sleeper, maybe I’ll head back to my long-time Destiny hobby, but maybe … Elden Ring!