Hello,
In installation/R/bin/R i notice
1. R_HOME_DIR is hard coded e.g.
R_HOME_DIR=/usr/local/lib64/R
2. It ignores R_HOME_DIR
echo "WARNING: ignoring environment value of R_HOME"
3. R_SHARE_DIR, R_INCLUDE_DIR and R_DOC_DIR are also hard coded.
Is there a reason why these settings do not re
08/01/rterra_first_post.html
Cheers
Saptarshi
On Thu, Mar 6, 2014 at 7:05 PM, Simon Urbanek
wrote:
> On Mar 6, 2014, at 5:32 PM, Saptarshi Guha wrote:
>
>> Hello,
>>
>> This is a question that probably reveals my lack of understanding.
>> In a C function (call it cfu
Apologies, I am resending this because my emails seem to go in HTML form.
(I haven't as yet figured gmail web interface)
Hello,
This is a question that probably reveals my lack of understanding.
In a C function (call it cfunc), i created a SEXP, called S, and then
called R_PreserveObject on S.
Apologies, I am resending this because my emails seem to go in HTML form.
Hello,
This is a question that probably reveals my lack of understanding.
In a C function (call it cfunc), i created a SEXP, called S, and then
called R_PreserveObject on S.
I returned the SEXP to the calling R function
hat R
> can't see, then R_PreserveObject would be appropriate, but the situations
> where doing that is a good idea are rare (though they do exist).
>
> HTH,
> ~G
>
>
>
>
> On Thu, Mar 6, 2014 at 2:32 PM, Saptarshi Guha
> wrote:
>
>> Hello,
>>
>
Hello,
This is a question that probably reveals my lack of understanding.
In a C function (call it cfunc), i created a SEXP, called S, and then
called R_PreserveObject on S.
I returned the SEXP to the calling R function (call it rfunc). Note, I
didn't call
R_ReleaseObject on S.
v <- .Call("cfun
True but I was hoping someone could point me where in the source code this
happens.
Cheers
Saptarshi
On Feb 3, 2014 3:37 AM, "Duncan Murdoch" wrote:
> On 14-02-03 3:41 AM, Saptarshi Guha wrote:
>
>> Hello,
>>
>> I was reading through serialize.c and i c
Hello,
I was reading through serialize.c and i couldn't answer something.
In readItem, case CHARSXP, rules exists to adjust the read string for
string encoding.
Q1. I couldn't find where the encoding of the elements of the string vector
are written? Is it when writeItem writes out the attribute
ns manual.
>
> Is there a reason this wouldn't work for your usecase? What exactly is it
> that you want to do?
>
> ~G
>
>
>
>
> On Mon, May 20, 2013 at 9:56 AM, Saptarshi Guha
> wrote:
>>
>> Hello,
>>
>> I have a double vector, x. I can ac
Hello,
I have a double vector, x. I can access the i'th element as
REAL(x)[i]
Is there a function for this? I know i can write my own, but was
seeing if one already exists. I did check Rinternals.h but didn't see
one.
Cheers
Saptarshi
__
R-devel@r-pr
Hello,
I have a double vector, x. I can access the i'th element as
REAL(x)[i]
Is there a function for this? I know i can write my own, but was seeing if
one already exists. I did check Rinternals.h but didn't see one.
Cheers
Saptarshi
[[alternative HTML version deleted]]
_
Hello,
I get an error when binary structures from a pipe
'Error: cons memory exhausted (limit reached?)' (but R does not crash)
This is probably due to some bug in my code, but occurs after reading
about 85K pairs of RAWSXP objects (each < 20 bytes).
I do not have any explicit calls to malloc/ca
Hello,
Is there a function(in R's C API), given a SEXP, that computes the
size in bytes, i.e. a C equivalent of object.size() ?
Thank you
Saptarshi
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Hello,
I create a VECSXP(call it A) with size N(~ 5000), i then proceed to
fill the elements and find out I don't need to fill more than
M (M<< N).
Thus if i return A to the user's R code, he/she will see a list of
length 5K of which N-M are NULLs.
To avoid this, I create a new VECSXP B of length
nice to open an R source file with a TOC, click on an entry and start
editing the function.
Thanks
saptarshi
On Mon, Feb 15, 2010 at 1:01 AM, Erik Iverson wrote:
> Martin Morgan wrote:
>>
>> On 02/14/2010 08:11 AM, Saptarshi Guha wrote:
>>
>>>
>>> Hello,
&
Hello,
Is it possible to extend the R lexer/parser to include multiline comments like
/*
acomment
*/
?
This way I can integrate emacs org-mode with my R code, so that I can
have a table of contents,
section folding, html-output of source etc.
e.g
/*
* Display Code
*/
#+BEGIN_SRC R
foo <- functio
Hello,
I notice in main/arithmetic.c, that NA and NaN are encoded
differently(since every numeric NA comes from R_NaReal which is
defined via ValueOfNA)
. What is the benefit of treating these two differently? Why can't NA
be a synonym for NaN?
Thank you
Saptarshi
(R-2.9)
___
a current version of Fedora, if that is the
>> Linux distribution you wish to stay with. Trying to debug compiler problems
>> on a Linux distribution that itself has not been supported in a long time is
>> asking for trouble.
>>
>> Marc Schwartz
>>
>>
>>
Hello,
The package builds successfully on RHEL5 and OS X( 64 bit,32/64
respectively) but on FC4(32 bit) it fails with this error
g++ -m32 -I/usr/include/R -I/usr/local/include-fpic -O2 -g -pipe
-Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
--param=ssp-buffer-size=4 -m32 -march
Hello
I was reading the source main/src/gram.y and had one question, how does R parse
x =
1
According the grammar:
prog: END_OF_INPUT{ return 0; }
| '\n'{ return xxvalue(NULL,2,NULL); }
| expr_or_assign '\n'
Hello,
In the src folder of my R package I have
a.cc
b.cc
f/g/x.cc
my Makevars.in has
all: $(SHLIB)
upon installing only, a.o and b.o is build and the final dll is
comprised of a.o and b.o
How can I instruct $(SHLIB) to pick up its source files from all
subdirectories (or maybe a subset,
those lists? Can you send us the code? If not, can you
> put up the .RData file? Without a reproducible example this is hard to debug
> ...
>
> Thanks,
> Simon
>
>
> On Oct 1, 2009, at 14:26 , Saptarshi Guha wrote:
>
>> Hello,
>> I have list of 600K lists, eac
Hello,
I have list of 600K lists, each sublist a list of two elements, the
first a character, the second a list of six named elements, some
characters some numrics.
LISTA (600K) (:= h)
|__ List of two elements
|__ Character
|__ Named List of 6 elements (characters and numeri
Thanks.
What caused problem?
Regards
Saptarshi
On Thu, Sep 24, 2009 at 6:20 AM, Duncan Murdoch wrote:
> Now fixed, in R-devel and R-patched.
>
> Duncan Murdoch
>
> On 23/09/2009 7:10 PM, Saptarshi Guha wrote:
>>
>> Hello,
>> I was trying this bit of code (i kn
nt physical address'
Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
Running on Leopard, Macbook (intel, 4gb ram)
R version 2.9.2 (2009-08-24)
(No libraries loaded)
Saptarshi Guha | saptarshi.g...@gmail.com | http://www.stat.p
Apparantly , calling Rf_duplicate on the return value message2rexp solves it.
Regards
Saptarshi
On Sun, Sep 20, 2009 at 12:04 AM, Saptarshi Guha
wrote:
> After some examination, this is what i found (i changed the code
> somewhat, i dont modify rawdata anymore)
>
> load(&
h of length 2
j=v[1:1] ; u=list();u=append(u,j)
and
j=v[1:15164] ; u=list();u=append(u,j)
both work but for n> 15164
j=v[1:n] ; u=list();u=append(u,j)
returns
Error: protect(): protection stack overflow
I have no idea why...
Regards
Saptarshi
On Sat, Sep 19, 2009 at 10:15 PM, Saptarshi
SET_VECTOR_ELT(rval,i,KV);
UNPROTECT(1);
}
UNPROTECT(1);
return(rval);
}
SEXP kk_(char *d,int n){
SEXP k;
REXP *rexp = new REXP();
rexp->Clear();
rexp->ParseFromArray(d,n);
PROTECT(k = message2rexp(*rexp));
delete(rexp);
UNPROTECT(1
After some reading, what i really need is something to give access to
PRIMNAME(obj).
Setting #define R_USEINTERNALS doesn't work and i'd rather not use
internals. Is the some exposed api call to get PRIMNAME?
Thank you
Saptarshi
On Sat, Sep 12, 2009 at 2:08 PM, Saptarshi Guha
wrot
Hello,
For the BUILTINSXP and SPECIALSXP types, the R Internals page documents
"An integer giving the offset into the table of primitives/.Internals. "
What macro gives me the value of this integer? I guess something like
this would work
had R_USEINTERNALS been defined
v->u.primsxp.offset
(wh
Oh!Thanks much. Worked perfectly.
Hadn't realized the importance of -Wall.
Regards
saptarshi
On Thu, Sep 3, 2009 at 7:27 PM, Simon
Urbanek wrote:
>
> On Sep 3, 2009, at 7:15 PM, Saptarshi Guha wrote:
>
>> Hello,
>> I'm evaluating this expression
>> express
Hello,
I'm evaluating this expression
expression({ for(x in 1:5){ .Call('rh_status','x') }})
a million times from a program with R embedded in it. I have attached
reproducible code that crashes with
Program received signal SIGSEGV, Segmentation fault.
0x2b499ca40a6e in R_gc_internal (size
Hello,
I'm using a Makevars.in file and running my code through gdb. I
understand i should turn of -O2, but R's makeconf overrides my
settings
/ln/meraki/custom/lib64/R/etc/Makeconf:112: warning: overriding
commands for target `.cc.o'
in Makevars.in
.cc.o:
g++ -g ${PKG_CXXFLAGS} ${PKG_LI
My own response:
use
%.o: %.cc
and not the form given below.
Regards
S
On Thu, Sep 3, 2009 at 12:59 PM, Saptarshi Guha wrote:
> Hello,
> I'm using a Makevars.in file and running my code through gdb. I
> understand i should turn of -O2, but R's makeconf overrides my
> s
Hello,
Is there a way, in C, to find how deep my current protection stack
is(apart from keeping a count).
I know the default nested size is 50,000 and because of some coding
error i think i'm reaching it.
Is there a way to find out the current depth reached?
Thank you
Saptarshi
___
Oh! Yes, this is the GC at work, "root objects" and everything
referenced from them.
I think I'm understanding the need for PROTECT better.
Thank you
Saptarshi
On Mon, Aug 24, 2009 at 9:39 AM, Duncan Murdoch wrote:
> On 8/24/2009 9:33 AM, Saptarshi Guha wrote:
>>
>&
that it is still in use.
> The next time it needs some memory it may decide to free y and re-use that
> space.
>
> Duncan Murdoch
>
>
>> On Aug 24, 2009, at 8:18 AM, Duncan Murdoch
>> wrote:r
>> C
>>>
>>> On 8/23/2009 11:52 PM, Saptarshi Guha
Hello,
Suppose I have the function
SEXP foo(){
SEXP s;
PROTECT(s=allocVector(...))
UNPROTECT(1);
return(s)
}
y=foo() // foo is a recusrive call
Q: Am i correct in understanding that one does not need to write
PROTECT(y=foo()) ?(and a corresponding unprotect later on)
since it is the object
Sorry about the clutter. The answer can be found on Writing R Extensions
"
8.1.3 Registering symbols"
Thank you
Saptarshi Guha
On Thu, Aug 13, 2009 at 10:01 PM, Saptarshi Guha
wrote:
>
> Essentially I'd like to load the C function into the load table
> After
Essentially I'd like to load the C function into the load table
After that, I can create an R function
rboo=function(x) .Call("boo",x)
then user script cann call rboo
Hope that clarifies things.
Thanks in advance
Saptarshi Guha
On Thu, Aug 13, 2009 at 9:07 PM, Saptarshi Guha
me
x<-1
boo(x)
One way is to create a library with function boo that performs .Call to boo,
but is there a way that I can do something like
ainstall("rboo", boo)
and calls to rboo in the language will be sent to 'boo' ?
Thank you
Saptarshi
Saptarshi Guha
Hello,
I've (by somewhat understanding serialize.c) understood how a vector
of type numeric/char/raw/logical are serialized, assuming they have no
attributes (e.g no attributes(x)=NULL).
I assumed for lists, the content of the list is written first and then
the names attribute. However nested list
Impressive stuff. Nice to see people giving some though to this.
I will explore the packages you mentioned.
Thank you
Saptarshi Guha
On Mon, May 11, 2009 at 12:37 AM, Patrick Aboyoun wrote:
> Saptarshi,
> I know of two alternatives you can use to do fast extraction of conse
there a more efficient method?
Regards
Saptarshi Guha
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Interesting stuff.
Thank you
Saptarshi
On Sat, May 2, 2009 at 7:21 PM, Dirk Eddelbuettel wrote:
>
> On 2 May 2009 at 18:53, Saptarshi Guha wrote:
> | Hello,
> | In ?set.seed I notice that a seed is created from the system time.
> | Thus if two machines were (hypothetically)
Hello,
In ?set.seed I notice that a seed is created from the system time.
Thus if two machines were (hypothetically) running for the same time
and R was started simultaneously on both, the would have the same
seeds (correct?).
I assume reading from /dev/random would be different for both of these
I have continued this on the stats-rosuda-devel mailing list.
Saptarshi Guha
On Sun, Apr 5, 2009 at 10:12 AM, Simon Urbanek
wrote:
>
> On Apr 5, 2009, at 9:26 AM, Saptarshi Guha wrote:
>
> Not sure if this the right place, but I can't seem to subscribe to the
>> rJava
CurrentThread(jvms[i], (void**)&jenv, NULL)) {
jvm=jvms[i];
break;
}
}
i++;
}
if (i==vms) error("Failed to attach to any existing JVM.");
}else {
JNI_CreateJavaVM(&jvm, (void **)&jenv, &args);
}
Hello,
I need to create a VECSXP(A) each element of which is a 2-element
VECSXP. Since I dont know
how many elements there will be i create a linked list of 2-element
VECSXP (see code at end)
Once I know the number of elements, i then go ahead allocVector A and
then SET_VECTOR_ELEMENT the
elements
Hello,
During a .Call e.g
while(TRUE){
value <-rhsqnextKVR(rdr) ## has .Call in this function
if(is.null(value)) break;
}
if I press CTRL-C, R exits straight to the command line.
Q: How can I prevent this? I should point out that my library uses
JNI, so I'm not sure if that is causing i
fuly ran it 4MM times.
Have I mis-understood the 5.9.1?
Thanks for your inputs.
Saptarshi Guha
On Sun, Mar 29, 2009 at 10:02 PM, Martin Morgan wrote:
>> // kxp and usar are two SEXP's which have not been protected
>> SEXP res
>> PROTECT(res);
>> res= allocVector(V
OR_ELT(names, 0, mkChar("key")); //A
SET_VECTOR_ELT(names, 1, mkChar("value")); //A
setAttrib(res, R_NamesSymbol,names); //A
UNPROTECT(2);
return(res);
Saptarshi Guha
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
On Jul 10, 2007, at 12:33 PM, Saptarshi Guha wrote:
> Hi,
> Some progress: I am using
> SEXP retty;
> book=Calloc(1,int);
> *book=10;
> PROTECT(retty=R_MakeExternalPtr(book,R_NilValue,R_NilValue));
>
> then UNPROTECTING and retur
ddress 0x0, cause 'invalid alignment'.
I can't figure out why... I would appreciate any advice provided.
Rgds
Saptarshi
On Jul 10, 2007, at 11:41 AM, Saptarshi Guha wrote:
> Hi,
> I am writing an R package with two functions in C++. So far
>
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 defi
55 matches
Mail list logo