Displaying 20 results from an estimated 1000 matches similar to: "reducing a too-large matrix obtained with allocMatrix()"
2012 Jul 31
1
ways of getting around allocMatrix limit?
I need to multiply to very large, nonsparse matrices, and so get the
error "allocMatrix: too many elements specified".
Is there a way to set the limit for allocMatrix?
In my case, the two matrices, A and B, are nxm and mxp where m is
small, so I could subdivide each into blocks of submatrices
A=rbind(A1,A2,...) and B=cbind(B1,B2,...) then multiply each pair of
submatrices, but I was
2009 Feb 17
1
allocMatrix error
On Sat, Feb 14, 2009 at 00:17, <ashrafi@ucdavis.edu> wrote:
Hi,
I was trying to read ~400 chips in an affybatch and I got the same message.
Could you find a remedy for that. My server has 128 GB of RAM. However, R
halted ever before it uses the memory.
I have been able to load upto 250 CEL files but this time I wanted to test
what would happen if I want to normalize 400 chips.
Thanks
2010 Jul 21
1
Question about allocMatrix error message
Dear R family,
I faced a technical problem in r coding.
#s=t(dev)%*%dev/(nr-1) # dev (100,000 by 2) stands for
deviation from the mean
#sinv=solve(s)
#t2=diag(dev%*%sinv%*%t(dev))
I got an error message at t2 statement:
Error in diag(dev %*% si %*% t(dev)) : allocMatrix: too many elements specified
Please let me know if there is a way to overcome this problem.
best
moohwan
2019 Aug 07
0
#include_next <stdio.h> not found
Yes, this did the trick, thanks very much! I?m cc?ing r-devel just for the record.
Roger Koenker
r.koenker at ucl.ac.uk<mailto:r.koenker at ucl.ac.uk>
Department of Economics, UCL
London WC1H 0AX.
On Aug 7, 2019, at 4:55 PM, Steven Dirkse <sdirkse at gams.com<mailto:sdirkse at gams.com>> wrote:
Roger,
Updating Xcode has the unfortunate side effect of wiping out the std
2012 Dec 06
0
Package party Error in model.matrix.default(as.formula(f), data = blocks) :allocMatrix: too many elements specified
Dear all:
I¡¯m trying to get unbiased feature importance of my data via package ¡°party¡±, which contains 1-5 integer value, and a few numeric values attributes. The class label is 1-5 integer value as well. In total I have 20 features with 1100 observations. I checked the type my data in R using class(my_data_cell), no factor has been observed. I received a commond error like others did
2009 Oct 23
1
Confusion regarding allocating Matrices.
Hi
I'm having slight confusion.
I plan to grow/realloc a matrix depending on the data available in a C
program.
Here is what I'm tried to do:
Data=allocMatrix(REALSXP,3,4);
SEXP Data;
REAL(Data)[8]=0.001123;
REAL(Data)[200000]=0.001125;
printf("%f %f\n\n\n\n",REAL(Data)[8],REAL(Data)[200000]);
Here is my confusion:
Do I always require to allocate the exact number of data
2007 Jul 10
1
How to preserve data across function calls in a library package
Hi,
I am writing an R package with two functions in C++. So far
everything works.
Now, i would like to write a third function which would use a pointer
(it is a pointer to a class object) created by first function.
I tried placing this pointer outside of the function definitions
(i.e to make it global) but when called in the 3rd function i get
> *** caught bus error ***
address 0x0,
2007 Jul 10
1
How to preserve data across function calls in a library package
Hi,
I am writing an R package with two functions in C++. So far
everything works.
Now, i would like to write a third function which would use a pointer
(it is a pointer to a class object) created by first function.
I tried placing this pointer outside of the function definitions
(i.e to make it global) but when called in the 3rd function i get
> *** caught bus error ***
address 0x0,
2019 Jun 14
2
R C API resize matrix
Hi,
Is there a way to resize a matrix defined as follows:
SEXP a = PROTECT(allocMatrix(INTSXP, 10, 2));
int *pa = INTEGER(a)
To row = 5 and col = 1 or do I have to allocate a second matrix "b" with
pointer *pb and do a "for" loop to transfer the value of a to b?
Thank you
Best regards
Morgan
[[alternative HTML version deleted]]
2006 Aug 03
1
question about dll crashing R
I have ported some R code to C to make it faster.
I can perform .Call("foobar",....) once and it
works fine. Absolutely correct answer.
If I put a loop inside foobar and run the main code
routine more than 100 times, it crashes R.
Or if I call .Call("foobar"....) seperately more than
two tims it crashes R.
For the most part I am doing matirx multiplies using
EXP
2013 Aug 27
1
Error in simulation. NAN
Hi all,
im triyng to implement a bayesian model with R and c++.
I have a strange problem. I can't reproduce the error with a small
script and then i post the original one.
The problem is after the line
for(MCMC_iter2=0;MCMC_iter2<thin;MCMC_iter2++)
For the first 34 iterations all work fine, after, all the simulations
of mu_acc_P return an "nan". If i delete the line
2014 Dec 18
2
segfault when trying to allocate a large vector
Dear R contributors,
I'm running into trouble when trying to allocate some large (but in
theory viable) vector in the context of C code bound to R through
.Call(). Here is some sample code summarizing the problem:
SEXP test() {
int size = 10000000;
double largevec[size];
memset(largevec, 0, size*sizeof(double));
return(R_NilValue);
}
If size if small enough (up to 10^6), everything is
2012 Dec 15
3
interfacing with .Call
Hi
My code is as following:
#include <R.h>
#include <Rinternals.h>
//* the Projector part *//
void Projector(double *L, int *dimL, double *G, int *dimG, double *W, int
*dimW, int *xymod, int *dimxy, double *modif, int *dimif, double *Lsum)
{ ...}
//* the interface part *//
#define getDim(A) INTEGER(coerceVector(getAttrib(A,R_DimSymbol), INTSXP))
SEXP Projector5(SEXP L, SEXP G,
2005 Sep 04
1
A memory management question
Can someone explain the use of SETLENGTH() and SETTRUELENGTH()?
I would like to allocate a vector and reserve some space at the end,
so that it appears shorter than the allocated size. So that I can
more efficiently append to the vector, without requiring a new copy
every time. So I'd like to use SETLENGTH() with a shorter apparent
length, and bump this up as needed until I've used the
2015 Feb 05
2
Invalid read of size 8
Hi,
I have a R program that call a C function. I define a vector of pointer as
int nLC=3;
int pownLC = nLC*nLC
double *MatCovExtra[nT+1];
for(k=0;k<K+1;k++)
{
MatCovExtra[k] = (double*)R_alloc(pownLC, sizeof(double));
}
where nT>K. Then i put some values on the vector associated with the
pointer:
for(k=0;k<K+1;k++)
{
for(i=0;i<nLC;i++)
2005 Apr 16
1
SET_LENGTH
Hello.
I'm trying to read a delimited file. I'm a little new
to the R api. In the program, I do something like
this...
/*****************************/
SEXP retval;
PROTECT(retval = allocMatrix(STRSXP,1,names.dim));
int r_eltctr = 0;
while(!myfile.eof())
{
SET_LENGTH(retval,r_eltctr+num_of_fields);
for(int i = 0;numofcolumns; ++i)
{
INTEGER(retval)[r_eltctr++] = 1;/*some
2011 Mar 29
7
Error en cor, too many elements specified
Hola, tengo una serie de datos datExpr, al usar cor() :
cor(datExpr ,method = "pearson", use ="pairwise.complete.obs")
me da el siguiente error
allocMatrix: too many elements specified
Trate con "complete.obs", "na.or.complete", y el resto de las opciones para "use", pero siempre me da algun error.
¿Alguna idea de como puedo hacer que cor() lea
2008 Jul 15
1
aov error with large data set
I'm looking to analyze a large data set: a within-Ss 2*2*1500 design
with 20 Ss. However, aov() gives me an error, reproducible as follows:
id = factor(1:20)
a = factor(1:2)
b = factor(1:2)
d = factor(1:1500)
temp = expand.grid(id=id, a=a, b=b, d=d)
temp$y = rnorm(length(temp[, 1])) #generate some random DV data
this_aov = aov(
y~a*b*d+Error(id/(a*b*d))
, data=temp
)
While yields the
2011 Jan 17
1
isoreg memory leak?
I believe there is a memory leak in isoreg in the current version of R,
as I believe the following shows
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 120405 3.3 350000 9.4 350000 9.4
Vcells 78639 0.6 786432 6.0 392463 3.0
> for(k in 1:100) {
+
+ y <- runif(10000)
+ isoreg(x,y)
+ }
> rm(x)
> rm(y)
> gc()
used (Mb) gc
2012 Dec 06
1
Use .Call interface
Hi
I've written the following program:
#include <R.h>
#include <Rdefines.h>
#include "Projector.h"
SEXP Projector2(SEXP L, SEXP G, SEXP W, SEXP xymod, SEXP modif){
int nprot=0;
PROTECT(L=AS_NUMERIC(L));nprot++;
PROTECT(G=AS_NUMERIC(G));nprot++;
PROTECT(W=AS_NUMERIC(W));nprot++;
PROTECT(xymod=AS_INTEGER(xymod));nprot++;
PROTECT(modif=AS_NUMERIC(modif));nprot++;