[R] Friendly way to link R - MySQL and non-(R and Mysql) users ?

Peter Dalgaard P.Dalgaard at biostat.ku.dk
Fri Nov 23 10:19:02 CET 2007


Ptit_Bleu wrote:
> Dear Gabor,
>
> Thanks for the links.
> I found a a tcl script (see below ; from http://wiki.tcl.tk/15977) which
> could be a good starting point but I'm not able to translate it into R.
> Could you help me ?
> In particularly, what is the command corresponding to
> append_float_dialog_item ?
> I looked in ?tcltk but I haven't found "append" command.
>   
I think you don't want to go there. That is a commercial raytracing
program, Shade, which embeds Tcl and extends it with some new commands.
For you to use this with R, you'd need to obtain Shade and figure out
how to embed it in R (or R in Shade, or R in Tcl in Shade...). If all
you need is how to code simple dialogs look for the Wettenhall demos at
http://bioinf.wehi.edu.au/~wettenhall/RTclTkExamples/
> Thanks in advance,
> Have a nice week-end,
> Ptit Bleu
>
> -----------------------------------------------------
>
> # Simple sphere demo with UI for Shade
>
>  # Variables: radius, center coordinates, RGB color
>  set r 600
>  set X 0
>  set Y 0
>  set Z 0
>  set R 1.0
>  set G 0.1
>  set B 0.1
>
>  # The UI starts here
>  begin_dialog
>
>  # Create a dialog box with 7 typed entries
>  append_float_dialog_item "Radius"
>  append_float_dialog_item "X center"
>  append_float_dialog_item "Y center"
>  append_float_dialog_item "Z center"
>  append_float_dialog_item "Red value (0..1)"
>  append_float_dialog_item "Green value (0..1)"
>  append_float_dialog_item "Blue value (0..1)"
>
>  # Initial values for items
>  set_float_property_value 0 to $r
>  set_float_property_value 1 to $X
>  set_float_property_value 2 to $Y
>  set_float_property_value 3 to $Z
>  set_float_property_value 4 to $R
>  set_float_property_value 5 to $G
>  set_float_property_value 6 to $B
>
>  # ask_dialog is true if we hit on OK button
>  if [ask_dialog] {
>    set r [get_float_property_value 0]
>    set X [get_float_property_value 1]
>    set Y [get_float_property_value 2]
>    set Z [get_float_property_value 3]
>    set R [get_float_property_value 4]
>    set G [get_float_property_value 5]
>    set B [get_float_property_value 6]
>    if {$R > 1.0} {set R 1.0}
>    if {$G > 1.0} {set G 1.0}
>    if {$B > 1.0} {set B 1.0}
>    end_dialog
>  } else {
>    end_dialog
>    error cancel_dialog
>  }
>  # End of UI
>
>  # Create a tagged sphere with radius r at <X,Y,Z> coordinates
>  create_sphere at [list $X $Y $Z] r $r sphere_1
>
>  # set color to sphere_1
>  set base_color [list $R $G $B]
>
>  # Render the result
>  render
>   


-- 
   O__  ---- Peter Dalgaard             Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)                  FAX: (+45) 35327907



More information about the R-help mailing list