QuickLookR – A macOS QuickLook plugin for R Data files
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
I had tried to convert my data-saving workflows to feather
but there have been issues with it supporting large files (that seem to be near resolution), so I’ve been continuing to use R Data files for local saving of processed/cleaned data.
I make many of these files and sometimes I do it as a one-off effort, thinking that I’ll come back to it quickly. Inevitably, I don’t do that and also end up naming those one-offs badly. I made a small R helper package to make it easier to wrap up checking out these files at the command-line (via a bash
function) but it hit me that it’d be even easier if there was a way to use the macOS Quick Look feature (hitting <spacebar>
on a file icon) to see the previews.
Thus, QuickLookR
was born.
You need to download the ZIP file, unzip it and save the QuickLookR.qlgenerator
component into ~/Library/QuickLook
. Then devtools::install_github('hrbrmstr/rdatainfo')
in an R session. If you’ve got R/Rscript in the standard /usr/local/bin
location, then you should be able to hit <spacebar>
on any .rdata
, .rda
or .rds
file and see a str()
preview like this:
I haven’t cracked open Xcode in a while and my Objective-C is super-rusty, but this works on my El Capitan MacBook Pro (though I’m trying to see why some .rds
files embedded in packages on my system have no previews).
If you have suggestions or issues, please use github to file them. For issues, it’d be really helpful if you included a copy of or link to files that don’t work well.
For the next revision, I plan on generating prettier HTML-based previews and linking against R.framework
to avoid a call out to the system.
If Wes/Hadley really have fixed feather
, I’ll be making a QuickLook plugin for that file format as well in the very near future.
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.