Learn R Programming

operators (version 0.1-8)

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

Author

Romain Francois <[email protected]>

See Also

Examples

Run this code
  if (FALSE) {
    rnorm(30) %|% 'head -n2'
    rnorm(30) %|% 'sed "s/^ *\\[[0-9]*\\]//g" '
    
    if( require(R4X ) ){
        x <- xml( '
            
              foo
              bar
            
            
              blah
              bob
              
            
            
               banana
               mango
            
          ' )
        x %|% "xml_pp | highlight -S xml -A"  
    }
  }

Run the code above in your browser using DataLab