Hi,

AKS> But when I want to get [transpose(weight)][s][weight] using following
AKS> syntax,

AKS> t(weight)%*%s%*%weight

I guess 'weight' and 's' are dataframes and you need matrices. Like
here:

x <- rnorm(8)
s <- matrix(rnorm(64), ncol=8)

t(x) %*% s %*% x   # this is OK

d <- as.data.frame(x)
t(d) %*% s %*% d  # this is your error


You can use data.matrix() to convert dataframes to matrices:

t( data.matrix(d) ) %*% s %*% data.matrix(d)   # again OK




HTH,

Michal

~,~`~,~`~,~`~,~`~,~`~,~`~,~`~,~`~,~

Michal Bojanowski
ICS/Utrecht
Utrecht University
Heidelberglaan 2; 3584 CS Utrecht
Room 1428
[EMAIL PROTECTED]

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to