R as a command-line tool for data science

September 24, 2013
By

(This article was first published on Revolutions, and kindly contributed to R-bloggers)

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)

To leave a comment for the author, please follow the link and comment on his blog: Revolutions.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.