Displaying 3 results from an estimated 3 matches for "largevec".
Did you mean:
argvec
2008 Oct 30
3
why does sample(x, n) give the same n items in every separate runs?
...nd small). Gene expression intensities of those genes are classified into 1 to 10 levels. What I want is to make a random set of genes that have the same levels as the small group from large group using sample().
I used smallvec to hold the number of genes in each levels (1 to 10) for small group, largevec for large group. I ordered the gene expression data frame of large group (largedf) by the levels and randomly chose the genes with same level as small group. Using the code below I can get the random set of genes from lagre group with same levels for small group. But I got the same set of genes whe...
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 fine. When it
reaches 10^7 as above, I get a segfault. As far as I know, a double
value is represented with 8 bytes, which would make largevec above
approx. 80Mo -> this i...
2014 Dec 18
0
segfault when trying to allocate a large vector
Hi Pierrick,
You're storing largevec on the stack, which is probably causing a stack
overflow. Allocate largvec on the heap with malloc or one of the R memory
allocation routines instead and it should work fine.
Karl
On Thu, Dec 18, 2014 at 12:00 AM, Pierrick Bruneau <pbruneau at gmail.com>
wrote:
>
> Dear R contributor...