Hello,
I’m using R 2.11.1 with Tinn-R 1.17.2.4.
I hope the given informations are enough (it’s my first entry here)

The as.environment(pos) error appears in using the following code which
should open a function in an other R-file.
Here some extractions of the code:

....

HZ<-tclVar(seq(length=a,from=1,by=0))        #(a is defined by a
tkentry-element)
VZ<-tclVar(seq(length=a,from=1,by=0))
Aktivität<-tclVar(seq(length=a,from=1,by=0))
VKG<-tclVar(3)
Zugehörigkeit is a matrix.       

#The values can be changed by a tkentry-element.

handler.Berechnung<-function() {
tkconfigure(Ergebnisfenster,
textvariable=tclVar(test2(as.numeric(tclObj(VKG)),as.numeric(tclObj(HZ))
,as.numeric(tclObj(VZ)),as.numeric(tclObj(Aktivität)),as.numeric(tclObj(
tclArray1)))))
}

test2 <- local({source("C:/Berechnung_Funktion.R", local = TRUE)
environment(Berechnung) <- .GlobalEnv
Berechnung })

and:
Button<-tkframe(InputOutputfenster)
tkpack(Button, side='top')
tkpack(tkbutton(Button, text='compute optimal
solution',command=handler.Berechnung))

and the function in the other R-file:
Berechnung<-function(a,b,c,d,e) {…}     

Thanks!

______________________________________________
R-help@r-project.org mailing list
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.

Reply via email to