Re: [Rd] Quoting

From: Vladimir Dergachev <>
Date: Tue, 22 May 2007 19:37:40 -0400

On Tuesday 22 May 2007 7:05 pm, Peter Dalgaard wrote:
> Vladimir Dergachev wrote:
> >> I think DTL's suggestion would be most useful when putting a lot of code
> >> in a string, where the escapes make the code harder to read. For
> >> example, just about any function using a complicated regular expression.
> >
> > Also anything using .Tcl(). Quotes in data frame definition are useful
> > because they could be employed to delimit text fields with spaces in
> > them.
> .Tcl() is usually the wrong solution anyway, you really should use tcl()
> unless absolutely necessary.

Actually I could not figure out how to use tcl() - it seems to work only to call a single Tcl/Tk command.

I mostly use .Tcl() to create guis along the lines of

foreach {control desc var value} {

	label "Just a description" title1 0
	entry "Edit some text" text_var {Hello there}
	} {
	switch -exact -- $control {
		label { 
			label .l$var -text $desc
			grid .l$var - -sticky news
		entry {
			label .l$var -text $desc
			entry .e$var -variable $var
			grid .l$var .e$var -sticky news
			global $var
			set $var $value
	# other control types follow

this can get pretty versatile and works for plots and other things..


                              Vladimir Dergachev

______________________________________________ mailing list Received on Tue 22 May 2007 - 23:40:22 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 23 May 2007 - 06:33:21 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.