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

I know that to run a shell script in R , the system command is used:

my.table <- system(command,intern=TRUE)

However, if the result of my “command” is to print the table, and I want R to read the table directly into its own data structure. (something like a data frame) Is there an easy way to do this? Because the current output in the "table" is a character table. What I want is an R object as read.table ().

+5
source share
2 answers

"" , "" read.table:

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

, pipe , system intern

inp.tbl <- read.table(pipe(command) )
+4

All Articles