Hi Henrik,
I'm sorry to be bothering you, but there is something that I have been
stuck with for a while now.

I am trying to create a class like :

setConstructorS3("MyPTCM",function(tokenslist=0)
{
       extend(Object(), "MyPTCM",
       .gamma = 0.0,
       .rho = 0.0,
       .phi = 0.0,
       .tokenslist = tokenslist,
       .uniquetokens = unique(tokenslist),
       .numtypes = length(uniquetokens),
       .Nsq = numtypes*numtypes,
       .CONTEXTti = array(0,dim=numtypes),
       .CONTEXTtim = array(0,dim=numtypes),
       .ZEROVEC = .CONTEXTti,
       .MTF = array(0.0,dim=c(numtypes,numtypes)),
       .hIN = array(0.0,dim=c(numtypes,numtypes)),
       .tokencount <- 0);
}
)

Everytime I try to create an object of type MyPTCM, it gives me an error saying
> b <- MyPTCM(tokens)
Error in extend.Object(Object(), "MyPTCM", gamma = 0, rho = 0, phi = 0,  :
       object "uniquetokens" not found

I have tried using this$.uniquetokens and just by referencing it with
.uniquetokens and other such techniques but to no avail.

I'm sure I'm making some basic fundamental mistake.
Any kind of inputs would be greatly appreciated.
Thanks in Advance,
Aditya

______________________________________________
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