R as a command-line tool for data science
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
Data Scientist Jeroen Janssens recently published a useful list of 7 data science tools that you can use from the command line. This doesn't just mean they're convenient tools for command-line junkies: it also means you can easily chain them together with data sources for offline, automated processes. Included in the list are JSON processing tools (jq, json2csv), the CSV conversion tool csvkit, XML extraction tools (scrape, xml2json), and a file-level row-sampling tool (sample). The analysis tool on the list is, as you might expect, R.
Janssens created a bash script called Rio to call R from the command line, but in fact there are already several options for using R in shell scripts and pipelines. You can redirect standard input and standard output with R as is typical with most command-line utilities, but R also provides a standard script — R CMD BATCH — for running R commands from a file and capturing the output in another file. You can even use R as a shell-scripting language using notation like #! /usr/local/Rscript at the top of an executable script file. (There's also littler, another handy command-line front-end for R.)
R is definitely an powerful tool for data science, and there are several options for making it part of your command-line workflow.
jeroen janssens: 7 command-line tools for data science (via Justin Martinstein)
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.