On Thu, Aug 20, 2009 at 1:27 PM, David Winsemius<dwinsem...@comcast.net> wrote:
...
> But an extremely simple modification "succeeds":
>
>  if ( 0 ) {"
>  commented with zero
>  "} else {"
>  commented with one
>  "}
>
> Returns:
> [1] "\ncommented with one\n"

Yes, but of course that executes neither one nor the other.  This works, though:

eval(parse(textConnection(if (FALSE) "
  syntactically //// incorrect ' code must not use double-quotes, though
" else "
 print('this is a test')
")))

though it is horribly ugly, so I second the suggestion to do this in
your text editor if you must do it at all.

          -s

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to