How to run shell script in R and get the output into table?

r, shell

Solution

If the result 'table' has white-space separators and carriage-returns to mark lines, then you should pass the results to the 'text' argument of read.table:

 inp.tbl <- read.table(text = system(command,intern=TRUE) )

Problem

I know to run a shell script in R is using system command: ``` my.table <- system(command,intern=TRUE) ``` However, if the result of my "command" is to print out a table, and I want R to read the table directly into its own data structure. (something like data frame) Is there an easy way to do that? Because the current output in "table" is a character string table. What I want is the R object as read.table().

Original source

Related problems