[R] problems with matrix, list and other..

billycorg billycorg1 at virgilio.it
Fri Jun 15 19:22:33 CEST 2007


thank you!
it works with:
E=list()
length(E)=1096
for(i in (2:1096)){E[[i]]=crossprod(solve(d[[i]]),cbind(e[[i]]))}




Petr Klasterecky wrote:
> 
> You only got what you deserved when not reading the manual...
> R-Intro, Chapters 5 and 6, page 26 in particular.
> http://cran.r-project.org/doc/manuals/R-intro.pdf
> 
> Petr
> 
> 
> billycorg napsal(a):
>> hi
>> 
>> can anyone help me to solve these problems?
>> 
>> i have:
>> 1) "d" matrix with 1096 rows;
>> for example, 
>> d[2]=        
>>                    [,1]           [,2]          [,3]
>> [1,] 0.1192566 0.0000000 0.0000000
>> [2,] 0.0000000 0.1065938 0.0000000
>> [3,] 0.0000000 0.0000000 0.1038888
>> 
>> if I
>> class (d[2]) = "list" 
>> solve(d[2]) = error!!!
>> 
>> 2) "e" list with 1096 rows;
>> for example
>> e[2]2=
>> [[1]]
>> [1] -1.0892216 -0.7304947 -1.2883680
>> 
>> d[2]%*%t(e[2])
>> this is the error: requires numeric matrix/vector arguments
>> 
>> i've tried to coerce "e" to a matrix, but it's doesn't work...
>> 
>> in the end.. i'd like this:
>> for (i in (1:1096)) {solve(d[i])*t(e[i])}
>> 
>> help me, please :)
>> 
>> Vincenzo
> 
> -- 
> Petr Klasterecky
> Dept. of Probability and Statistics
> Charles University in Prague
> Czech Republic
> 
> ______________________________________________
> R-help at stat.math.ethz.ch 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.
> 
> 

-- 
View this message in context: http://www.nabble.com/problems-with-matrix%2C-list-and-other..-tf3926701.html#a11144182
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list