Learn R Programming

operators (version 0.2.0)

pipe: Pipe an R object to a unix command

Description

The operator prints the R object into a temporay file and then executes the unix command though a pipe

Usage

r %|% u

Value

An object of S3-class unixoutput. The print method for unixoutput objects simply cat the string.

Arguments

r

Any R object

u

character string representing the unix command

Examples

Run this code
if (FALSE) {
   rnorm(30) %|% 'head -n2'
   rnorm(30) %|% 'sed "s/^ *\\\\[[0-9]*\\\\]//g" '
}

Run the code above in your browser using DataLab