Re: [R] Error message: object of type 'closure' is not subsettable

2012-03-01 Thread Petr PIKAL
Hi If you want sensible response you need to ask sensible question and more importantly provide working example or at least an example that produces the error you want get rid of. with test.functional.t(res.em1,res.em2,mint,maxt,se.m=0,points=300) I get Error in seq(mint, maxt, length.out

Re: [R] Error message: object of type 'closure' is not subsettable

2012-03-01 Thread Aparna Sampath
Dear Petr I am sorry about the code being incomplete. I also take note of not using R keywords and functions as variable names. I was able to overcome my problem using unlist(). Thanks. Regards Aparna On Thu, Mar 1, 2012 at 3:57 PM, Petr PIKAL petr.pi...@precheza.cz wrote: Hi If you want

Re: [R] Error message: object of type 'closure' is not subsettable

2012-02-28 Thread Aparna Sampath
Hi All I am trying to use the unlist() in R to a list variable. The following statements are within a function. { denominator - sqrt(s1 / res.em1$n + s2 / res.em2$n) returnValue - l2 / (denominator + 11) attr(returnValue,numerator) - l2 attr(returnValue,denominator) - denominator

Re: [R] Error message: object of type 'closure' is not subsettable

2012-02-28 Thread Joshua Wiley
Hi Aparna, Can you please post a reproducible example? It is difficult to provide much concrete help without having testStatistics. One thing you might try is looking at: str(testStatistics[numerator,]) is it actually a list? If it is not (most likely given the error) and it is supposed to

Re: [R] Error message: object of type 'closure' is not subsettable

2012-02-28 Thread Joshua Wiley
Hi Aparna, If you have not defined testStatistics in your code, but it is a function, then either you defined it at some earlier point and it was never removed, or some other package you loaded defines it. You could try using your code in a clean R session (make sure that an old workspace is not

Re: [R] Error message: object of type 'closure' is not subsettable

2012-02-28 Thread Aparna Sampath
Hi Josh Kindly find below the code as it is executed: test.functional.t - function(res.em1,res.em2,mint,maxt,se.m=0,points=300) { at - seq(mint,maxt,length.out=points) by - at[2] - at[1] mu1 - spline(x=res.em1$tau,y=res.em1$eta,xout=at,method=natural)$y l2 - functional.norm(mu1,mu2,by=by)

Re: [R] Error message: object of type 'closure' is not subsettable

2012-02-28 Thread Petr PIKAL
Hi Difficult to without knowing what objects you are operating your functions. I get test.functional.t(1:10,1:10,3,4) Error in res.em1$eta : $ operator is invalid for atomic vectors moderated.functional.t(1:10) Error in testStatistics[numerator, ] : incorrect number of dimensions And

Re: [R] Error message: object of type 'closure' is not subsettable

2012-02-28 Thread Aparna Sampath
Hi Josh, Petr I checked that testStatistics is a function but it is not defined in the code anywhere else. But if I am able to remove it and give the input by my own to the function which calls testStatistics, it might work. The hurdle here for me is that the input is a set* of values and each

Re: [R] Error message: object of type 'closure' is not subsettable

2011-08-24 Thread Newbie
I think I have found my problem, but I dont know how to correct it. I have found an old post saying that it might be a problem if the starting values are evaluated at Inf (see link here http://r.789695.n4.nabble.com/Help-about-nlminb-function-td3089048.html) But how can I run nlminb without the

Re: [R] Error message: object of type 'closure' is not subsettable

2011-08-21 Thread Newbie
Thank you for your help, even though there was such an obvious mistake, Im sorry for that I have now tried to incorporate your suggested solution, but just as last time (the other post that you referred to), I get the values of the initial parameters when I run nlminb. I have changed the code a

Re: [R] Error message: object of type 'closure' is not subsettable

2011-08-19 Thread Berend Hasselman
Newbie wrote: Dear R-users I need to calibrate kappa, rho, eta, theta, v0 in the following code, see below. However when I run it, I get: y - function(kappahat, rhohat, etahat, thetahat, v0hat) {sum(difference(k, t, S0, X, r, implvol, q, kappahat, rhohat, etahat, thetahat, v0hat)^2)}

[R] Error message: object of type 'closure' is not subsettable

2011-08-18 Thread Newbie
Dear R-users I need to calibrate kappa, rho, eta, theta, v0 in the following code, see below. However when I run it, I get: y - function(kappahat, rhohat, etahat, thetahat, v0hat) {sum(difference(k, t, S0, X, r, implvol, q, kappahat, rhohat, etahat, thetahat, v0hat)^2)} nlminb(start=list(kappa,