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,我的 shell 路径上有 cygwin 我想要做的是通过 R shell 命令向 gawk 发送命令:shell("gawk"{print $1}"", m[1], "_", h[i]."_79.7.dat""} 我收到此错误错误:"shell("gawk"{" 中出现意外'{' 我该如何解决这个问题?谢谢
逃避你的报价。仅示例(不确定 R shell 语法是什么)
shell("gawk \"{print $1}\"", m[1],"_", h[i]."_79.7.dat"")
尝试转义引号以获得正确的结果。
另一种方法是先构建您的 gawk 命令字符串,然后传递给shell()
shell()