[Rd] R command line and pipe using in Linux?

Petr Savicky savicky at cs.cas.cz
Mon Feb 14 19:36:44 CET 2011

On Mon, Feb 14, 2011 at 05:40:29PM +0000, Hang PHAN wrote:
> Hi,
> I have a very large data file(GB) from which I only want to extract one
> column to draw histogram. This would be done several times, so I would like
> to ask if there is anyway to plot this using R from the linux command line,
> something look like this
> cut -f1 xxx.txt |RplotHist ....

Hi Hang:

Can you use something like the following?

  x <- as.numeric(system("cut -f1 xxx.txt", intern=TRUE))

According to ?system, long lines will be split, however, no limit
on the number of lines of the output is formulated there.

Petr Savicky.

More information about the R-devel mailing list