Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
こんにちは、Windows XP で R を使用しています。シェル パスに cygwin があります。次のように、R シェル コマンドを介して gawk にコマンドを送信します: shell("gawk "{print $1}"", m[1], "_", h[i]."_79.7.dat""} このエラーが表示されます Error: unexpected '{' in "shell("gawk "{" どうすればこの問題を解決できますか? ありがとうございます
引用符をエスケープします。例のみ(Rシェル構文が何かわからない)
shell("gawk \"{print $1}\"", m[1],"_", h[i]."_79.7.dat"")
正しい結果を得るには、引用符をエスケープしてみてください。
もう1つの方法は、最初にgawkコマンド文字列を作成してから、に渡すことです。shell()
shell()