Hi i am using R on windows XP i have cygwin on my shell path what i want to do is send a command to gawk via R shell command this way: shell("gawk "{print $1}"", m[1],"_", h[i]."_79.7.dat""} i get this error Error: unexpected '{' in "shell("gawk "{" how can i fix this problem? Thank you
+1
A:
escape your quotes. Example only (not sure what R shell syntax is)
shell("gawk \"{print $1}\"", m[1],"_", h[i]."_79.7.dat"")
experiment with escaping the quotes to get the correct result.
The other way is to build your gawk command string first , then pass to shell()
ghostdog74
2010-07-21 05:24:47
Shouldn't the final `}` be a `)`?
nullglob
2010-07-21 07:02:31
thank you!! another thing i didn't do is add paste()--> shell(paste(("gawk \"{print $1}\"", m[1],"_", h[i]."_79.7.dat""))
eliavs
2010-07-25 05:54:49