R passing data frame to another program using system()

Viewed 250

I have a data frame that I pass to another program using system(). In the current setup, I first write the contents of the dataframe to a text file, then have the system() command look for the created text file.

df1 <- runif(20)
write(df1, file="file1.txt")
system("myprogram file1.txt")

I have 2 questions:

1) Is there a way to pass a dataframe directly without writing the text file?

2) If not, is there are way to pass the data in memory as a text formatted entity without writing the file to disk?

Thanks for any suggestions.

1 Answers
Related