Re: [R] how to handle no lines in input with pipe()

2011-04-12 Thread Andrew Yee
Thank you very much for your suggestion...that works perfectly. Thanks, Andrew On Mon, Apr 4, 2011 at 5:46 PM, Prof Brian Ripley wrote: > On Mon, 4 Apr 2011, Andrew Yee wrote: > >> This has to do with using pipe() and grep and read.csv() >> >> I have a .csv file that I grep using pipe() and read

Re: [R] how to handle no lines in input with pipe()

2011-04-04 Thread Jeff Newmiller
Perhaps use tryCatch... --- Jeff Newmiller The . . Go Live... DCN: Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Embedded Controllers) .OO#.

Re: [R] how to handle no lines in input with pipe()

2011-04-04 Thread Prof Brian Ripley
On Mon, 4 Apr 2011, Andrew Yee wrote: This has to do with using pipe() and grep and read.csv() I have a .csv file that I grep using pipe() and read.csv() as follows: read.csv(pipe('grep foo bar.csv')) However, is there a way to have this command run when for example, there is no "foo" text in

[R] how to handle no lines in input with pipe()

2011-04-04 Thread Andrew Yee
This has to do with using pipe() and grep and read.csv() I have a .csv file that I grep using pipe() and read.csv() as follows: read.csv(pipe('grep foo bar.csv')) However, is there a way to have this command run when for example, there is no "foo" text in the bar.csv file? I get an error messag