TclTk object in R -


I am new to R (and programming in general), so apologies if it has been answered a bit more then

find me No response was received, but any help or direction would be very good!

I am trying to create a clickable interface on R, where I can click the users to find a file

  requirement (tcltk) Getfile & lt; - Function () {Name & Lieutenant  

; -tclvalue (tkgetOpenFile (file type = "{{CSV files} {.csv}}")) if (name == "") return; Datafile & lt; - read.csv (name, header = t)} tt & lt; -tktoplevel () button.widget & lt; -tkbutton (tt, text = "select csv file for analysis", command = getfile) tkpack (button .widget) #CV variable of the CSV file is placed in 'datafile'

However, when I try to execute it, and after clicking the button, click on the CSV file of interest, nothing happened.

  Error: object 'datafile' not found  

Once again, any help is greatly appreciated thanks!

The top-level object contains an environment in which you can store things, keep them in the local GUI done Give your callback as an argument:

  #backback that reads a file and stores DF at upper level dev: getfile & lt; - Function (tt) {name & lt; - tclvalue (TkgetOpenFile (filetypes = "{{CSV files} {.csv}}")) if (name == "") returns; Tt $ env $ datafile & lt; - read.csv (name, header = T)} #backback that does something for data frames (must first check existence!) Dosomething & lt; - function (tt) {print (summary (tt) $ env $ datafile))} # create a dialog with a load button and do some button: tt & lt; --tktoplevel () button.choose & lt; - tkbutton (tt, text = "select csv file", command Tkpack (button.choose) button.dosomething <- tkbutton (tt, text = "do something", command = function () {dosomething (tt) } Tkpack (Button. It should be quite strong, although I'm not sure if there is something already in the environment that you should be careful in the stomach, then create and use an environment in that environment. For storage.  

If you want to exit the dialog and do things for the user Prompt for micro want to save, name and assign or to store them in . GlobelEnv to exit.


Comments

Popular posts from this blog

winforms - C# Form - Property Change -

java - Messages from .properties file do not display UTF-8 characters -

javascript - amcharts makechart not working -