On Fri, May 9, 2014 at 8:15 AM, az14 <abidi.zineb@gmail.com> wrote:

> Hi, acctually it's for the (LM tests for spatial panel data).
> w is a distance matrix ( wih cut of 70km) .
> M <- matrix(1, nrow=9, ncol=9)
> W9 <- kronecker(W, M)
> I get this error:
>
> Erreur dans `dimnames<-.data.frame`(`*tmp*`, value = list(n)) :
>   invalid 'dimnames' given for data frame
>
>
>
Is this what your are after?

> x = matrix(1:9, 3)
> x
     [,1] [,2] [,3]
[1,]    1    4    7
[2,]    2    5    8
[3,]    3    6    9
> y = x[rep(1:nrow(x), each = 3), rep(1:ncol(x), each = 3)]
> y
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9]
 [1,]    1    1    1    4    4    4    7    7    7
 [2,]    1    1    1    4    4    4    7    7    7
 [3,]    1    1    1    4    4    4    7    7    7
 [4,]    2    2    2    5    5    5    8    8    8
 [5,]    2    2    2    5    5    5    8    8    8
 [6,]    2    2    2    5    5    5    8    8    8
 [7,]    3    3    3    6    6    6    9    9    9
 [8,]    3    3    3    6    6    6    9    9    9
 [9,]    3    3    3    6    6    6    9    9    9
>


THK


>
>
> --
> View this message in context:
> http://r-sig-geo.2731867.n2.nabble.com/Repeat-columns-and-rows-of-matrix-tp7586408p7586411.html
> Sent from the R-sig-geo mailing list archive at Nabble.com.
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



-- 
http://www.keittlab.org/

	[[alternative HTML version deleted]]

