Skip to content
Prev 172240 / 398506 Next

Bash script that uses an R command

stephen sefick wrote:
This is one for little r (http://dirk.eddelbuettel.com/code/littler.html)

$ echo "4.95" | r -e "x <- as.numeric(readLines()); cat( floor(x),':', 
round( ( x - floor( x ) ) * 60 ),'\n',sep='') "
4:57

Romain