Displaying 20 results from an estimated 7000 matches similar to: "memory problem with DEC C (was: problem with glm (PR#452))"
2005 Nov 07
3
R thread safe
Dear R-dev,
I would like to accelerate my R computation by using parallel OpenMP compilers
(e.g from Pathscale) on a 2-processor AMD server and I would like to know
whether R is a tread safe library. The main kernel of the OpenMP
parallelization is a C SEXP function that performs the computational routine in
parallel with:
*******************
SEXP example(SEXP list, SEXP expr, SEXP rho)
{
2014 Jun 24
2
using C code to create data frame but always return as list
there is my code, expect return value is a data frame but R say it is list:
SEXP Julia_R_MD_NA_DataFrame(jl_value_t* Var)
{
SEXP ans,names,rownames;
char evalcmd[4096];
int i;
const char* dfname="DataFrameName0tmp";
jl_set_global(jl_main_module, jl_symbol(dfname), (jl_value_t*)Var);
//Get Frame cols
sprintf(evalcmd,"size(%s,2)",dfname);
jl_value_t*
2003 Nov 03
2
lang2(...) with two and more arguments
Dear R-help,
how could I create an R call in C code using lang2 with 2 and more
arguments? I tried this code:
SEXP f(SEXP fn, SEXP rho)
{
SEXP R_fcall, x, y;
PROTECT(R_fcall = lang2(fn, R_NilValue));
PROTECT(x = allocVector(REALSXP, 1));
PROTECT(y = allocVector(REALSXP, 1));
REAL(x)[0] = 10;
REAL(y)[0] = 20;
SETCADR(R_fcall, x);
SETCADR(R_fcall, y);
2000 Feb 19
1
problem with glm (PR#452)
I'm having sporadic problems with glm on my alpha workstation running
Compaq Tru64 UNIX V5.0 (I can't replicate the problem on my Linux PC). I
have the same problem whether I use a version of R built with the native
C-compiler or a version compiled with gcc. In both cases I've built with
g77.
I want to do some simulations with a call to glm in each rep. A simplified
version would be
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
2006 Mar 27
1
Safe to UNPROTECT() when object is assigned to a list?
Hi,
I'm troubleshooting some native code on Windows that very occationally
(and semi-randomly) crashes R. Already looked at "everything", I just
want to double check that it is safe to UNPROTECT() allocated
variables as soon as they are assigned to, say, a PROTECTed list.
>From (R v2.3.0) Section 5.7.1 "Handling the effects of garbage
collection" in "Writing R
2006 Nov 17
1
Manipulating R lists in C
Hi,
I have been studying the R manual on lists but cannot seem to create a
simple R list in C - I keep on getting "'dimnames' applied to non-array"
whenever I attempt to assign names to the list elements:
Wanted output a list structure something like
[ type="Bid", price=2.0, volume=1000 ]
I can get up to a list of
[ "Bid2, 2.0, 1000 ]
But for the life of
2000 Jul 12
1
getAttrib() and setAttrib()
Hello:
I am looking at "Writing R Extensions", subsection 3.6.4, using R 1.1.0,
under NT4.0, with VC++ 6.0. Under these conditions I can use the first
method given for coding the out() function, but not the second, which uses
getAttrib() and setAttrib(). I hope that someone will tell me how this
second method can also be made to work. Details follow, for anyone kind
enough to help.
2014 Jun 26
1
using 2D array of SEXP for creating dataframe
Hi ,
For our production package i need to create a dataframein C . So I wrote
the following code
SEXP dfm ,head,df , dfint , dfStr,lsnm;
*SEXP valueVector[2];*
char *ab[3] = {"aa","vv","gy"};
int sn[3] ={99,89,12};
char *listnames[2] = {"int","string"};
int i,j;
//=============================
PROTECT(df = allocVector(VECSXP,2));
2009 Mar 30
1
Setting the names attribute of a list?
Hello,
I have created a vector with 2 elements(see code below)
I am calling this function many thousands of times (hundreds of
thousands) after some time
i get
*** caught segfault ***
address 0x5, cause 'memory not mapped'
However, if i dont set the R_NamesSymbol, I do not get any such error.
Am I doing this correctly?
Thank you
Saptarshi
==CODE===
// kxp and usar are two SEXP's
2014 Apr 02
0
special handling of row.names
Hello,
I think there is an inconsistency in the handling of the compact form of the row.names attributes.
When n is the number of rows of a data.frame, the compact form is c(NA_integer_,-n), as in:
> d <- data.frame(x=1:10)
> .Internal(inspect(d))
@104f174a8 19 VECSXP g0c1 [OBJ,NAM(2),ATT] (len=1, tl=0)
@103a7dc60 13 INTSXP g0c4 [] (len=10, tl=0) 1,2,3,4,5,...
ATTRIB:
@104959380
2008 Jan 04
1
Evaluating R expressions from C
I am currently puzzled by a passage in the R Extensions manual, section 5.10:
SEXP lapply(SEXP list, SEXP expr, SEXP rho)
{
R_len_t i, n = length(list);
SEXP ans;
if(!isNewList(list)) error("`list' must be a list");
if(!isEnvironment(rho)) error("`rho' should be an environment");
PROTECT(ans = allocVector(VECSXP, n));
2013 Apr 01
2
Timing of SET_VECTOR_ELT
Assume a C program invoked by .Call, that returns a list.
Near the top of the program we allocate space for all the list elements. (It is my habit
to use "xyz2" for the name of the R object and "xyz" for the pointer to its contents.)
PROTECT(means2 = allocVector(REALSXP, nvar));
means = REAL(means2);
PROTECT(u2 = allocVector(REALSXP, nvar));
u =
2011 Aug 13
1
Latent flaw in SEXPREC definition
There seems to be a latent flaw in the definition of struct SEXPREC
in Rinternals.h, which likely doesn't cause problems now, but could
if the relative sizes of data types changes.
The SEXPREC structure contains a union that includes a primsxp,
symsxp, etc, but not a vecsxp. However, in allocVector in memory.c,
zero-length vectors are allocated using allocSExpNonCons, which
appears to
2004 Feb 18
0
return a list of vectors from C?
I've been working on a shared library that will be called from R. The
functions pass several vectors in and out (residuals, parameters, etc) and I
would like to be able to return a list of objects. I'm familiar with return
single objects (vectors, etc) from a C function, but need a little help for
returning a list of objects.
My code so far looks something like:
/* this function will
2004 Feb 18
0
return a list of vectors from C?
I've been working on a shared library that will be called from R. The
functions pass several vectors in and out (residuals, parameters, etc) and I
would like to be able to return a list of objects. I'm familiar with return
single objects (vectors, etc) from a C function, but need a little help for
returning a list of objects.
My code so far looks something like:
/* this function will
2006 Aug 21
1
return tree from .Call
Hello:
I was hoping to get some advice about how to return a tree (basically a
linked list -- with each node containing a parent, left, and right node
pointers) from a C routine back into R. Each node itself contains several
attributes (a double, a char *, an int, and a void * )
Initially I was thinking I could just return to R a SEXP containing a
pointer to the Root Node, but then realized
2010 Sep 08
0
Correction to vec-subset speed patch
I found a bug in one of the fourteen speed patches I posted, namely in
patch-vec-subset. I've fixed this (I now see one does need to
duplicate index vectors sometimes, though one can avoid it most of the
time). I also split this patch in two, since it really has two
different and independent parts. The patch-vec-subset patch now has
only some straightforward (locally-checkable) speedups for
2014 Mar 06
1
Create dataframe in C from table and return to R
Hi ,
I am trying to create a dataframe in C and sebd it back to R. Can anyone
point me to the part of the source code where it is doing , let me explain
the problem I am having .
--------------------------------------------------------------------
My simple implementation is like this
SEXP formDF() {
SEXP dfm ,df , dfint , dfStr,lsnm;
char *ab[3] =
2013 Nov 26
1
dynamic lists at C level
Dear R-devel,
I am trying to do something similar to dynamic length lists in R, but
at C level.
In R, that would be rather trivial:
- determine the length of the list
- create the list object
- store the values for each component
- access value components by using "[["
At C level, for a single component where I need to store a vector of
length 5, I do:
int *p_result;
SEXP my_list =