search for: adiag

Displaying 8 results from an estimated 8 matches for "adiag".

Did you mean: diag
2004 Oct 01
2
multiple dimensional diag()
...ys, "a" and "b", with length(dim(a))==length(dim(b)). I want to form a sort of "corner-to-corner" version of abind(), or a multidimensional version of blockdiag(). In the case of matrices, the function is easy to write and if a=matrix(1,3,4) and b=matrix(2,2,2), then adiag(a,b) would return: [,1] [,2] [,3] [,4] [,5] [,6] [1,] 1 1 1 1 0 0 [2,] 1 1 1 1 0 0 [3,] 1 1 1 1 0 0 [4,] 0 0 0 0 2 2 [5,] 0 0 0 0 2 2 I am trying to generalize this to two higher dimensional arrays. I...
2008 Mar 15
3
empty array
Hi the list Is it possible to create an empty matrix ? I do not mean an matrix with a single value that is NA (which is not empty) but a real empty one, with length=0. I do not understand why we have length(numeric()), length(factor()) and length(character()) to zero, and length(array()) to one... Any rason for that ? Thanks Christophe
2005 Sep 01
1
More block diagonal matrix construction code
Folks: In answer to a query, Andy Liaw recently submitted some code to construct a block diagonal matrix. For what seemed a fairly straightforward task, the code seemed a little "overweight" to me (that's an American stock analyst's term, btw), so I came up with a slightly cleaner version (with help from Andy): bdiag<-function(...){ mlist<-list(...) ## handle case in
2005 Aug 31
1
Block-diagonal matrix
Dear R-users, Does anybody know how to construct a block-diagonal matrix (with the blocks being different matrixs, concerning the dimension and the values), without use loops ? Thanks all, Caio --------------------------------- [[alternative HTML version deleted]]
2007 Oct 23
1
create diagonal matrix within a for cycle
? stato filtrato un testo allegato il cui set di caratteri non era indicato... Nome: non disponibile Url: https://stat.ethz.ch/pipermail/r-help/attachments/20071023/b860b22b/attachment.pl
2005 Jan 28
2
Direct sum of matrices
Hi R users: How can I built a direct sum function of matrices in R? I mean A(mxn), B(pxq), C(rxs),... X<-ds(A,B,C,...) X = [ A, 0, 0 0, B, 0 0, 0, C] ((m+p+r+...) x (n+q+s+...)) Thank you for your help. Kenneth -- Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
2005 Aug 20
2
diagonal matrices
Hello all, I have matrices V.i of dimension n.i x n.i, where i = 1, ..., J, and the sum of n.i equals N. (and n.i ! = n.j) goal: create one large matrix V, where V has matrices V.i on diagonal. I create each matrix V.i in a for loop (1 to J), so each time I'd like to augment V with the most recently calculated V.i, such that I'll have V after the final iteration of the for loop.
2007 Apr 27
4
Randomising matrices
I would like to be able to randomise presence-absence (i.e. binary) matrices whilst keeping both the row and column totals constant. Is there a function in R that would allow me to do this? I'm working with vegetation presence-absence matrices based on field observations. The matrices are formatted to have sites as rows and species as columns. The presence of a species on a site is