inShell: Convert R code to the character vector of shell commands...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/inShell.R

Description

The function takes R commands, deparses them, substitutes existing variables, and converts everything to character strings, from which a shell command is created that sends the given R code to the R interpreter. Function is used internally to print the commands of R rules into Makefile.

Usage

1

Arguments

...

R commands to be converted

Value

A character vector of shell commands, which send the given R code by pipe to the R interpreter

Author(s)

Michal Burda

See Also

rRule(), markdownRule()

Examples

1
2
3
4
5
inShell({
  x <- 1
  y <- 2
  print(x+y)
})

Example output

Registered S3 method overwritten by 'pryr':
  method      from
  print.bytes Rcpp
[1] "$(R) -e '{' \\"           "-e '    x <- 1' \\"      
[3] "-e '    y <- 2' \\"       "-e '    print(x + y)' \\"
[5] "-e '}'"                  

rmake documentation built on May 1, 2019, 10:37 p.m.