[R] coerce mode list?
Mehdi Ghafariyan
mehdi_ghafariyan at yahoo.com
Tue Sep 19 12:10:26 CEST 2000
Dear R/S users;
I'm using S+ version 4 Release 3.
and I am trying to do a simple calculation like the
following :
> X1<-X[1:5]
> W1<-W[1:5,1:5]
> X1
[1] 1.250000 1.292308 1.176471 0.937500 1.538462
> W1
VAR00003 VAR00004 VAR00005 VAR00006 VAR00007
1 0 1 0 1 0
2 1 0 0 0 1
3 0 0 0 0 1
4 1 0 0 0 0
5 0 1 1 0 0
> Xbar1 <- mean(X1)
> S1 <- (t(X1 - Xbar1)) %*% W1 %*% (X1 - Xbar1)
Error in as.double: Cannot coerce mode list to double:
.Data = list(..
Dumped
> S1 <- (t(as.double(X1 - Xbar1))) %*% W1 %*%
(as.double(X1 - Xbar1))
Error in as.double: Cannot coerce mode list to double:
.Data = list(..
Dumped
I don't understand the error message. Can anyone help?
Many thanks in advance.
Mehdi
__________________________________________________
Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
http://im.yahoo.com/
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list