> y <- c(5.5199668,  1.5234525,  3.3557000,  6.7211704,  7.4237955,  1.9703127,
+        4.3939336, -1.4380091,  3.2650180,  3.5760906,  0.2947972,  1.0569417)
> x <- c(1,   0,   0,   4,   3,   5,  12,  10,  12, 100, 100, 100)
> 
> fn<-function(x,y){
+ lreg<-lm(y ~ x)
+ }
> fn(x,y)
> 
> b<-coef(fn)
Error: object of type 'closure' is not subsettable

can you please correct this error and explain to me what is the problem with 
this code,that i am get the above error


thankx

        [[alternative HTML version deleted]]

______________________________________________
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