similar to: Error: subscript out of bounds.

Displaying 20 results from an estimated 20000 matches similar to: "Error: subscript out of bounds."

2008 Aug 07
2
Creating an array of lists
Hi, I want to store some number of outputs from running a bunch of analyses such as lm() into an array. I know how to do this with a one-dimensional array (vector) by creating myArray <- vector(mode='list', length=10) and storing each lm() result into a component of myArray. My question is, how can do this for a multiple dimensional array? It seems array() does not have such a
2008 Jul 11
1
Subsetting an array by a vector of dimensions
Hi Is it possible to subset an n-dimensional array by a vector of n dimensions? E.g. assume I have > x <- array(1:24, dim=2:4) > x[1,1,2] [1] 7 > dims <- c(1,1,2) I would like a function that I can supply x and dims as parameters to, and have it return 7. Also, I would like to do something like: > x[1,1,] [1] 1 7 13 19 > dims2<- c(1,1,NA) And have a function of x and
2008 May 18
2
*apply function for arrays?
Hi all, I've recently been writing functions which may deal with very large arrays. And I hope to use *apply functions in the program so that the code may look nicer and the performance may be better in the following two situations. The first situation is: I'm having an array A with dim(A)==c(m,n,p). And I want to apply a function F to a group of elements in A like: 1) F is applied to
2010 Jun 14
2
error: subscript out of bounds?
Hi all, I want to get results for cox proportional hazards on SNP data. I'm trying to get HRs, CI's, & p-values for each individual SNP - this is represented by cov[,i]. When I run my code, I get the following error: subscript out of bounds. I don't know why I am getting this error. I have looked through the R logs, but nothing that has been previously suggested has helped so
2008 Dec 23
1
Ordered Multidimensional Arrays
Hi, I am inquiring as to what are the best practices with respect to storing and manipulating ordered multi-dimensional arrays. For example, suppose I have a sequence of time-varying covariance matrices of asset returns. The data is ordered, but the ordering is not necessarily regular (e.g. daily data omitting weekends and holidays, etc.). The data array is say, N x N x T. For example, the
2007 Mar 09
4
Using large datasets: can I overload the subscript operator?
Hello, I do some computations on datasets that come from climate models. These data are huge arrays, significantly larger than typically available RAM, so they have to be accessed row-by-row, or rather slice-by slice, depending on the task. I would like to make an R package to easily access such datasets within R. The C++ backend is ready and being used under Windows/.Net/Visual Basic, but I have
2003 Jul 30
6
reverse array indexing
Hi, Suppose I have a multidimensional array: tmp <- array(1:8, c(2,2,2)) is there a function out there that, given a one-dimensional array index, will return the separate indices for each array dimension? for instance, tmp[8] is equivalent to tmp[2,2,2]. I'd like to derive the vector (2,2,2) from the index 8. thanks, Brad Buchsbaum
2008 Oct 01
2
Bug or feature with finding a list element?
This seems odd. When I try to look up a list element which has a space in the name using just the first word (i.e. no spaces), it will sometimes return the element with a space in the name and sometimes it will return NULL. Try this: alist <- list( 'hello'=10, bye=20, 'hello world'=30, 'goodbye world'=40, 'hi world'=50, 'goodbye foo'=60, 'goodbye
2008 Jun 04
2
array of arrays
Dear R users, I want to calculate the bias and variance of an estimator for several values of two parameters a and b. For example : b1 b2 a1 bias bias variance variance a2 bias bias variance variance Can one do array of arrays ? I have tried and it did not work. Actually I would like to get this array for several values of the number of observations. That
2007 Dec 19
1
Genetic algorithm for feature selection
Hi, I'm looking for a R-package that does feature selection for PLS using a genetic optimization algorithm. I couldn't find one on CRAN and I wonder whether there is a free one. I would be very appreciative for any help. Regards Rolf
2004 Mar 13
2
recursive matrix multiplication question
List serv subscribers, I am wondering if there is an efficient means of doing recursive matrix multiplication in R. My data resides in a 4 X 2541 matrix from which I need to extract 2541 2X2 matrices based on each row. If I attempt something like this: function(AO) {A<-AO {for(t in 1:4)
2003 Apr 26
5
R help
Hi, How to convert a var-covar matrix to correlation matrix. Thanks --------------------------------- [[alternate HTML version deleted]]
2011 Sep 27
1
array extraction
hello everyone. Look at the following R idiom: a <- array(1:30,c(3,5,2)) M <- (matrix(1:15,c(3,5)) %% 4) < 2 a[M,] <- 0 Now, I think that "a[M,]" has an unambiguous meaning (to a human). However, the last line doesn't work as desired, but I expected it to...and it recently took me an indecent amount of time to debug an analogous case. Just to be explicit, I would
2005 May 10
4
summary statistics for lists of matrices or dataframes
Is there a simple way to calculate summary statistics for all the matrices or dataframes in a list? For example: > z <- list(matrix(c(2,2,2,2), ncol = 2), matrix(c(4,4,4,4), ncol = 2)) > z [[1]] [,1] [,2] [1,] 2 2 [2,] 2 2 [[2]] [,1] [,2] [1,] 4 4 [2,] 4 4 > I would like to calculate, for example, the mean value for each cell. I can do that the hard
2005 Jun 22
2
Contour Plots
Hello all. I'm confused a bit about contour plots. After reading the help at "?contour", it seems as though the contour plot is for 3D plots (x,y, and z). My data is in the form of grid coordinates (x,y), and I want to see a contour plot of the data so that I can tell where most observations lie. My question is simple but still evasive. Say my data is called places. One column
2007 Jan 03
2
accessing arrays
hi all. how can i adress a array directly. for example i wanna give array 1 other labels than array 2. How can I overcome this problem? ...this doesn't work tab <- array(1:8, c(2, 2, 2)) dimnames(tab[,,1]) <- list(c("No","Yes"), c("No","Yes"),c("ARRAY1")) dimnames(tab[,,2]) <- list(c("big","small"),
2007 Aug 15
3
Covariance of data with missing values.
I have a data matrix X (n x k, say) each row of which constitutes an observation of a k-dimensional random variable which I am willing, if not happy, to assume to be Gaussian, with mean ``mu'' and covariance matrix ``Sigma''. Distinct rows of X may be assumed to correspond to independent realizations of this random variable. Most rows of X (all but 240 out of 6000+ rows)
2006 Apr 18
5
3D pie
Hi all, Is there a way to draw 3D pie with R (like excel does)? I know how to do it in 2D, just by using pie(something)... I know it isn't the best way to represent data, but people are sometimes more interested by the look and feel than by the accuracy of the results... If there is no way, have you another suggestion ? (i already use dotchart instead of pie) Thks to all of
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
2004 Mar 29
9
Aggregating frequency of irregular time series
> S-Plus has the function AggregateSeries() whose name is self > explanatory. For instance one can derive monthly series from daily > ones by specifying end-of-period, averages, sums, etc. I looked for > a similar function in the packages "its" and "tseries", but found > nothing. I also help.searched() for aggregate to no avail. Would > anybody be so kind