I used the RStudio tool profvis this weekend to find speed improvement opportunities in Armorer. I suspected that I could rewrite a big operation that calculates the maximum of many columns across several thousand rows. Holy smokes: Using matrixStats::rowMaxs
cuts processing time by an amazing amount!
I finished a big update to Armorer this week, to enable inclusion of subclass fragments in stat calculations. I learned a ton with this release and laid good groundwork for additional mod management. I’m pretty pleased!
I’m happy to have improved some R code today using group_split
, replacing my prior method of cycling through a data frame to build several new subsets. I’m not sure it’s more efficient given the size of the data set, but it sure reads more nicely.
Super-pleased to see that a couple of small Shiny app improvements I made this weekend correctly picked up on some source data changes today and automatically handled them. Pretty cool!
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.
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)
}
)
I had a good time this weekend coming up with a new way to visualize armor stat distribution in my Destiny 2 profiler tool. 🎮
Just learned of {httr2} (https://github.com/r-lib/httr2), a rewrite of R’s httr package, and am excited to try it out! The pipeable API looks like a nicely improved way to build complex requests.
I’ve had a nice afternoon working on my hobby R/Shiny project, a loadout finder for the game Destiny 2. These improvements make it a lot more flexible and informative: It can now optionally include armor that would otherwise be filtered out of configurations by the minimum stat threshold, and it will show current mods used in displayed loadouts.