R で 2 つの bash コマンドをパイプしようとしていますが、パイプが壊れているというエラーが発生します。どんな提案でも大歓迎です。私がいる場所は次のとおりです。
#Create a long file (2GB on your drive...)
write.csv(rep(1,1E8),file="long.txt", row.names=FALSE)
system("grep 1 tmp.txt") #This works
system("grep 1 tmp.txt| head -n 10") #This gives a broken pipe error
grep:writing output:broken pipe 短いファイルで正常に動作します。どうすれば回避できますか?
ありがとう。