[R] problems with matrix, list and other..
Petr Klasterecky
klaster at karlin.mff.cuni.cz
Fri Jun 15 14:45:30 CEST 2007
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
More information about the R-help
mailing list