Re: [R] Get Information

From: Greg Snow <>
Date: Mon, 10 Nov 2008 09:25:57 -0700

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

> -----Original Message-----
> From: [mailto:r-help-bounces_at_r-
>] On Behalf Of justin Kameni
> Sent: Saturday, November 08, 2008 12:39 PM
> To:
> Cc:
> 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]] mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Mon 10 Nov 2008 - 16:30:00 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 Mon 10 Nov 2008 - 16:30:23 GMT.

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

list of date sections of archive