[R] Get Information

Greg Snow Greg.Snow at imail.org
Mon Nov 10 17:25:57 CET 2008


Your code creates the menu that will run the cascade function.  The cascade function gets a name from the user to save, but you don't do anything with the name other than return it, and the code that calls cascade does nothing with the return value.  If you want the text in the text window saved, then you will need to add that functionality to the cascade function, first you will need to extract the text from the text widget, then using R commands and the filename you can save the information (see the cat command for one way of doing this).

--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
801.408.8111


> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of justin Kameni
> Sent: Saturday, November 08, 2008 12:39 PM
> To: r-help at r-project.org
> Cc: r-help-request at r-project.org
> Subject: [R] Get Information
>
> I am a new commer in R. I am using the library tcltk, i need few
> information about it.
> so that, i wrote the following programme to save the file, but when i
> save the file, i do not find the file save, please help me, in order to
> continue my projet.
> this is the programme:
>
> tt  <- tktoplevel()
> txt <- tktext(tt)
> tkwm.title(tt,"Saisi des modalités") #intitule la fenêtre
> tkgrid(txt)
> tkmark.set(txt,"insert","0.0")
> topMenu <- tkmenu(tt)
> tkconfigure(tt,menu=topMenu)
> cascade =function ()
> {fileName=tclvalue(tkgetSaveFile(initialfile="modalite.txt",filetypes="
> {{JPEG Files} {.jpg .jpeg}} {{PDF File} {.pdf}} {{Text File} {.txt}}
> {{All files} *}"))
>                       return(fileName)
>                       }
> tkadd(topMenu,"command",label="Enregistrer",command=function ()
> cascade()) Please correct the programme i send it back. Please, i need
> the correction to continue my projet.
> Thanks in advance.
>
>
>  Ing KAMENI Justin
> Etudiant en Master en Statistique
> Option: Econométrie,
> Assurance et Finance
> Data Management et Data Mining
> Gsm: 0032487710413
> Route de Blocry 29/003
>
>
>
>
>         [[alternative HTML version deleted]]



More information about the R-help mailing list