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

Jesús Para Fernández j.para.fernandez at hotmail.com
Thu Oct 22 11:16:51 CEST 2015


Thanks, but it does´nt do what I want.

What I wnat is to insert it into a tktext. 

Jesús

Date: Thu, 22 Oct 2015 10:06:20 +0100
Subject: Re: [R] Get the output of a function in R GUI
From: kmezhoud at gmail.com
To: j.para.fernandez at hotmail.com
CC: r-help at r-project.org

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