similar to: n-dimensional vector operations

Displaying 20 results from an estimated 10000 matches similar to: "n-dimensional vector operations"

2011 Jun 13
1
Composing two n-dimensional arrays into one n+1-dimensional array
If I have 2 n-dimensional arrays, how do I compose them into a n+1-dimension array? Is there a standard R function that's something like the following, but that gives clean errors, handles all the edge cases, etc. abind <- function(a,b) structure( c(a,b), dim = c(dim(a), 2) ) m1 <- array(1:6,c(2,3)) m2 <- m1 + 10 abind(m1,m2) ==> , , 1 [,1] [,2] [,3] [1,] 1 3 5
2017 Jul 14
3
Making 2 dimensional vector from the 3 dimensional one
Hi All, I want to make a 1 dimension vector from the first two dimensions of a 3 dimension array, so make a 2 dimension vector from a 3-dimension one, with "fusing" (making as.vector) the first two dimensions. It seems to be very easy, but I cannot find the solution, I mean it would very strange, that I would do taking the single 1 dimensional vectors from the 3 dimensional one, make one
2012 Oct 15
2
Chopping a two column data frame by rows into a three dimensional array.
If I have a two column data frame like: > dat <- cbind("x"=c(1:100),"y"=c(100:1)) How can I create an array that splits every ten rows of that data frame into a third dimension of an array so that: > newarray[,,1] ,,1 x y 1 100 2 99 3 98 ... ... 10 91 ,,2 x y 11 90 12 89 ... ... ... Thanks. [[alternative HTML version deleted]]
2013 Nov 26
0
[LLVMdev] Help needed with a pass
I'm a newbie to LLVM and I've really been struggling to write a pass which changes the behavior of the following function: #include<stdlib.h>#include<stdio.h>#include<string.h>void foo(char* bar){const char* path;path=getenv(<SOME_ENV_VAR>); if (path!=NULL){strcpy(bar,path);}else{printf("env_var not set!");}} In the pass, I hope to invoke
2011 Sep 20
1
Boxplots from 4 dimensional array
Hello list members, I am working with simulated data for landscape pattern analysis. I have 1000 replicates of binary (2 colour) gridded landscapes at each combination of 9 levels of class proportion and 11 levels of spatial autocorrelation. The results are stored in an array as follows: > dim(surfaces) [1] 38 9 11 1000 The dimensions are defined as follows: [x,,,] 1:38, integers
2011 Dec 22
2
Indexing multi-dimensional table
I want to take slices of a multi-dimensional table (or array) without knowing the number of dimensions in advance. As a test I tried using (in this example a 3d table): do.call(`[`, list(tbl, x,NULL,NULL)] where I built the list on the fly. It works great as long as I only want the first dimension however when I try a different dimension, say with list(tbl,NULL,x,NULL), I get
2006 Aug 02
2
multi dimensional array
how to implement multi dimensional array in ruby in ruby multi dimension array look like tree structure plz help me & explain with code have a pleasant day thx narayana -- Posted via http://www.ruby-forum.com/.
2009 Nov 09
1
multiple tests: t-statistic for vectors in 4-dimensional array
Hi everyone, I created a four dimensional vector (dim (128,128,1,8)). This third dimension is necessary for another function somewhere. Now I'd like to perform a t-test on every vector of length 8 in my array on the fourth dimension. I'd like to obtain a new array of three dimensions with dimensions 128x128x1 with all these test statistics. I tried this with a double loop: A <-
2012 Jul 13
1
integrating multi-dimensional dat along one dimension
I just want to integrate a 3D data set along one dimension to obtain a 2D data set. Something like: (given array "d" with dim nx,ny,nz ...) data_int<-array(dim=c(nx,ny)) for (n in 1:ny) { for (m in 1:nx) { data_int[m,n]<-sum(d[m,n,]) } } The thing is, given R's facility with integers, it seems that I should be able to obtain data_int without the
1997 Dec 05
1
R-alpha: is.vector of one-dimensional array
maybe we've already diskussed this before, but Kurt and I can't remember ... is.vector() of an one-dimensional array returns FALSE. this is also the behavior of Splus, but totally counter-intuitive for me ... IMO an array of dimension 1 is exactly the definition of a vector ... it also breaks our current plot.factor, which is simply a barplot(table(x)) table() returns an
2011 Feb 18
6
sort a 3 dimensional array across third dimension ?
I'm attempting to sort a 3 dimensional array that looks like this > x , , 1 [,1] [,2] [1,] 9 9 [2,] 7 9 , , 2 [,1] [,2] [1,] 6 5 [2,] 4 6 , , 3 [,1] [,2] [1,] 2 1 [2,] 3 2 Such that it ends up like this .... > y , , 1 [,1] [,2] [1,] 2 1 [2,] 3 2 , , 2 [,1] [,2] [1,] 6 5 [2,] 4 6 , , 3 [,1] [,2]
2004 Jul 30
0
P-value from the joint cumulative distribution of an n-dimensional order statistic
Hello, I want to compute the P-value from the joint cumulative distribution of an n-dimensional order statistic in R, using the formula found on http://cmgm.stanford.edu/%7Ekimlab/multiplespecies/Supplement/methods_network.html My data consists of three different techniques (G2D, POCUS and RANDOM), and each has associated with it a number of rankings (integer between 0 and 1000), like for
2012 Sep 12
0
[LLVMdev] Multi-dimensional array accesses in LLVM-IR | Thoughts
On Wed, 12 Sep 2012 14:18:43 +0200 Armin Größlinger <armin.groesslinger at uni-passau.de> wrote: > Hi, > > I had a few thoughts about recovering multi-dimensional accesses in > Polly and maybe it's time to share them. > > On 09/12/2012 10:38 AM, Tobias Grosser wrote: > > [...] Even in the last example which contains parameters both for > > the sizes and
2012 Sep 12
1
[LLVMdev] Multi-dimensional array accesses in LLVM-IR | Thoughts
Hi, I had a few thoughts about recovering multi-dimensional accesses in Polly and maybe it's time to share them. On 09/12/2012 10:38 AM, Tobias Grosser wrote: > [...] Even in the last example which contains parameters both for the > sizes and the offsets, the parameters for the sizes are the only ones that > appear on the right hand sides ('8 * %m * %o' and '8 *
2004 Aug 31
0
N-dimensional delaunay tesselation & voronoi diagrams
Hi, I've been looking for functions that can do delaunay tesselation and generate voronoi cells. I came across deldir and tripack but both seem to be restricted to 2D points. Are there any packages that can do a tesselation in N dimensions? I know that Matlab and Mathematica use the qhull package to provide functions for this. Does anybody know of any R packages that do this (maybe by calling
2010 Jan 05
1
variable three dimensional array
I am using R for my bioinformatics research. I am dealing with a graph in which I need to find all possible path. I was looking for some package that solve my purpose but all in vain. There are available algorithms but most of them find shortest path that ignore other paths So I decided to write my own from scratch. I need to create a two dimensional matrix of size nXn. The element of each entry
2012 Oct 16
1
How to create a high-dimensional matrix
Hi, everyone I need to create a 429497 x 429497 matrix. When I use *matrix(0,429497,429497)* I got the error information : Error in matrix(0, 429497, 429497) : too many elements specified Then I use "ff" package, try to store this matrix on disk * x<-ff(0,dim=c(429497,429497)* And I got the error information : Error in if (length < 0 || length > .Machine$integer.max)
2009 Oct 09
1
Get subset of n dimensional matrix
I want to select a subset of an array, but I want to make a function so that it can handle any number of dimensions. This is probably best described with an example > x <- 1:100 > dim(x) <- c(10,10) > x [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 1 11 21 31 41 51 61 71 81 91 [2,] 2 12 22 32 42 52 62 72 82 92 [3,]
2008 Jul 21
2
avoid loop with three-dimensional array
Dear R user, I'm trying to find a solution for optimizing my code. I have to run a 50.000 iteration long simulation and it is absolutely necessary to have an optimized code. I have to do this operation *sum_t ( t(X_t) %*% A %*% X_t )* where X_t is a (d*k) matrix which changes in time and A is a constant in time (d*d) matrix. I have put all my X_t in a three dimensional array X of dimension
2004 Jan 07
1
3-dimensional looping Q.
Hello everyone- I have a 3-d array with the 1st dimension being monthly mean data that I would like to correlate with some time series index, for example, and save the coefficients in an array. The code I am currently running is.... rData <- array(0,c(73,144)) # array to store results for (i in 1:73) { for (j in 1:144) { rData[i,j] <- cor(slp[,i,j],y)