fue: Run R functions from the CLI

Description Details Examples

Description

Rather than running R functions via a script, fue::go constructs a function call and runs it directly, to be used via R -e.

Details

Shell arguments that begin with "–" can specify names for arguments, everything else is matched positionally using standard R matching rules.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Not run: 
  # the following all call scale(mtcars, center=TRUE, scale=FALSE)
  R -e "fue::go(scale)" --args  --no-scale --center --x=mtcars
  R -e "fue::go(scale)" --args  mtcars --scale=FALSE --center
  R -e "fue::go(scale)" --args  --no-scale mtcars TRUE

## End(Not run)

## Not run: 
  # Bash quoting can be tricky at times. This is a shell issue, not an R issue.
  R -e "fue::go(paste)" --args  '"Here I am"' '"Rock you like a Hurricane"'

## End(Not run)

## Not run: 
 # included is a shell script "fuego" that does all the boilerplate:
 fuego scale --no-scale mtcars TRUE

## End(Not run)

nfultz/fuego documentation built on May 8, 2019, 3:39 p.m.