[R] Get the output of a function in R GUI

Karim Mezhoud kmezhoud at gmail.com
Thu Oct 22 11:06:20 CEST 2015


Hi,

require(tcltk)
data<-c(2,3,5,2)
PressedOK <- function()
{
  tkmessageBox(message=sum(data))
}

tt <- tktoplevel()
OK.but <- tkbutton(tt,text="OK",command=PressedOK)
tkgrid(OK.but)
tkfocus(tt)

Please take a look in examples:
http://mcu.edu.tw/~chenmh/teaching/project/r/reference/RTclTkExamples/
Karim

On Thu, Oct 22, 2015 at 9:49 AM, Jesús Para Fernández <
j.para.fernandez at hotmail.com> wrote:

> Hi,
>
> I want to create my own RGUI, so I´m using tcltk for that.
>
> In a very simple example, I want to get the response of a function into a
> tktext, so I have done this:
> data<-c(2,3,5,2)
> tt<-tktoplevel
> text<-tktext(tt)
> tkpack(text)
> sum(data)
>
> How can I get the output of sum(data) in my tktext??
>
> Thanks!
> Jesús
>
>         [[alternative HTML version deleted]]
>
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

	[[alternative HTML version deleted]]



More information about the R-help mailing list