Displaying 20 results from an estimated 23 matches for "set_tag".
Did you mean:
get_tag
2008 Apr 24
1
Calling R functions with multiple arguments from C
...9;ve read that
discussion, but still got stuck. Could anybody point me in the right
direction?
SEXP foo(SEXP fn, SEXP elmt1, SEXP elmt2, SEXP rho)
{
SEXP R_fcall, args, ans,s;
PROTECT( args = s = allocList(2));
PROTECT( R_fcall = lang2(fn, R_NilValue) );
SETCAR(s,elmt1);
SET_TAG(s,install("x"));
s = CDR(s);
SETCAR(s,elmt2);
SET_TAG(s,install("y"));
SETCADR( R_fcall, args);
PROTECT( ans = eval(R_fcall, rho) );
UNPROTECT(3);
return ans;
}
foo.func <- function(x,y)match.call()
>.Call("foo",foo.func,x=10,...
Control statements with condition with greater than one should give error (not just warning) [PATCH]
2017 Mar 03
2
Control statements with condition with greater than one should give error (not just warning) [PATCH]
..."error"
* "error.messages"
* "show.error.messages"
@@ -248,9 +249,9 @@
char *p;
#ifdef HAVE_RL_COMPLETION_MATCHES
+ PROTECT(v = val = allocList(22));
+#else
PROTECT(v = val = allocList(21));
-#else
- PROTECT(v = val = allocList(20));
#endif
SET_TAG(v, install("prompt"));
@@ -289,6 +290,10 @@
SETCAR(v, ScalarLogical(0)); /* no checking */
v = CDR(v);
+ SET_TAG(v, install("check.condition"));
+ SETCAR(v, ScalarLogical(0)); /* no checking */
+ v = CDR(v);
+
p = getenv("R_KEEP_PKG_SOURCE");...
2014 Apr 03
1
question regarding lang2 command in C
Hi ,
I am asking too many questions , sorry for that . I am creating a data
frame in C itself , reading a table .
The data frame calling code looks like this
======================================
*PROTECT(dfm=lang2(install("data.frame"),df));*
*SEXP res = PROTECT(eval(dfm,R_GlobalEnv));*
UNPROTECT(2);
return res;
==================================
It works fine , now the problem
Control statements with condition with greater than one should give error (not just warning) [PATCH]
2017 Mar 03
0
Control statements with condition with greater than one should give error (not just warning) [PATCH]
...sages"
> @@ -248,9 +249,9 @@
> char *p;
> #ifdef HAVE_RL_COMPLETION_MATCHES
> + PROTECT(v = val = allocList(22));
> +#else
> PROTECT(v = val = allocList(21));
> -#else
> - PROTECT(v = val = allocList(20));
> #endif
> SET_TAG(v, install("prompt"));
> @@ -289,6 +290,10 @@
> SETCAR(v, ScalarLogical(0)); /* no checking */
> v = CDR(v);
> + SET_TAG(v, install("check.condition"));
> + SETCAR(v, ScalarLogical(0)); /* no checking */
> + v = CDR(v);
>...
2015 Feb 24
0
2.4.1 and Meta update from DIFFERING IP's - Status?
...ss on a per mount level. Should be rather
simple in a server side scripting language of your choice.
If you want to modify 2.4.1, then you could always revert this commit:
https://trac.xiph.org/changeset/15264
changing the two if statements from:
if (same_ip && plugin && plugin->set_tag)
back to:
if (plugin && plugin->set_tag)
Then rebuild Icecast.
Thomas
2008 Mar 29
0
"Writing R Extensions": bad example with CAR / CDR as lvalues (PR#11054)
...i.e. construct the call: rm( list=s, envir=ev ) */
SEXP call;
PROTECT( call = Rf_allocList( 3 ) );
SET_TYPEOF( call, LANGSXP );
SETCAR( call, install( "rm" ) );
SETCAR( CDR(call), allocVector( STRSXP, 1 ) );
SET_STRING_ELT( CAR( CDR(call) ), 0, mkChar( s ) );
SET_TAG( CDR(call), install("list") );
SETCAR( CDDR(call), ev );
SET_TAG( CDDR(call), install("envir") );
eval( call, R_GlobalEnv );
UNPROTECT( 1 );
2014 Jun 25
1
Need help on calling Head from C
Hi ,
I am trying to call head function from C . My doubt is with the parameter
n,how to pass it .
PROTECT(dfm=lang3(install("data.frame"),df,ScalarLogical(FALSE)));
SET_TAG(CDDR(dfm), install("stringsAsFactors")) ;
SEXP res = PROTECT(eval(dfm,R_GlobalEnv));
PROTECT(head=lang3(install("head"),res,ScalarInteger(1)));
head = PROTECT(eval(head,R_GlobalEnv));
I tried the above following , it seemed to be not working . Can you please
help.
Thanks
[...
2020 Jun 30
3
Build a R call at C level
....
>
> call_to_sum <- inline::cfunction(
> language = "C",
> sig = c(x = "SEXP"), body = "
>
> SEXP e = PROTECT(lang2(install(\"sum\"), x));
> SEXP r_true = PROTECT(CONS(ScalarLogical(1), R_NilValue));
> SETCDR(CDR(e), r_true);
> SET_TAG(CDDR(e), install(\"na.rm\"));
> Rf_PrintValue(e);
> SEXP ans = PROTECT(eval(e, R_GlobalEnv));
> UNPROTECT(3);
> return ans;
>
> ")
>
> call_to_sum(c(1L,NA,3L))
>
> On Tue, Jun 30, 2020 at 10:08 AM Morgan Morgan
> <morgan.emailbox at gmail.com> w...
Control statements with condition with greater than one should give error (not just warning) [PATCH]
2017 Mar 03
2
Control statements with condition with greater than one should give error (not just warning) [PATCH]
...; char *p;
>
> > #ifdef HAVE_RL_COMPLETION_MATCHES
> > + PROTECT(v = val = allocList(22));
> > +#else
> > PROTECT(v = val = allocList(21));
> > -#else
> > - PROTECT(v = val = allocList(20));
> > #endif
>
> > SET_TAG(v, install("prompt"));
> > @@ -289,6 +290,10 @@
> > SETCAR(v, ScalarLogical(0)); /* no checking */
> > v = CDR(v);
>
> > + SET_TAG(v, install("check.condition"));
> > + SETCAR(v, ScalarLogical(0)); /* no checking */
>...
2008 Mar 31
1
(PR#11054) "Writing R Extensions": bad example with CAR /
...s, envir=ev ) */
>
> SEXP call;
> PROTECT( call = Rf_allocList( 3 ) );
> SET_TYPEOF( call, LANGSXP );
>
> SETCAR( call, install( "rm" ) );
>
> SETCAR( CDR(call), allocVector( STRSXP, 1 ) );
> SET_STRING_ELT( CAR( CDR(call) ), 0, mkChar( s ) );
> SET_TAG( CDR(call), install("list") );
>
> SETCAR( CDDR(call), ev );
> SET_TAG( CDDR(call), install("envir") );
>
> eval( call, R_GlobalEnv );
> UNPROTECT( 1 );
>
> ______________________________________________
> R-devel at r-project.org mailing list...
2020 Jun 30
2
Build a R call at C level
Hi All,
I was reading the R extension manual section 5.11 ( Evaluating R expression
from C) and I tried to build a simple call to the sum function. Please see
below.
call_to_sum <- inline::cfunction(
language = "C",
sig = c(x = "SEXP"), body = "
SEXP e = PROTECT(lang2(install(\"sum\"), x));
SEXP ans = PROTECT(eval(e, R_GlobalEnv));
UNPROTECT(2);
return
2006 Jul 05
1
i suspect that there a memory leak in "vmmin"?
...n 3ff7c27d.
Registers:
eax=000063ac ebx=01e773a0 ecx=3ff7c27a edx=00000002 esi=01e254b4
edi=00000002
eip=100dec2f esp=00e0ecb0 ebp=00e0ed78 iopl=0 nv up ei pl nz na pe
nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000
efl=00000202
Call stack:
100DEC2F R.dll:100DEC2F SET_TAG
100E0527 R.dll:100E0527 Rf_allocVector
100E0D37 R.dll:100E0D37 R_alloc
100F2ACA R.dll:100F2ACA vmmin
023F5E96 gem.dll:023F5E96 weibullMH
10088C33 R.dll:10088C33 do_dotcall
100B8827 R.dll:100B8827 Rf_eval
100BA4D2 R.dll:100BA4D2 do_set
100B86CB R.dll:100B86CB Rf_eval
100BA5D5 R.dll:...
2023 Nov 11
1
New syntax for positional-only function parameters?
6 ?????? 2023 ?. 22:54:24 GMT+03:00, mikkmart via R-devel <r-devel at r-project.org> ?????:
>The pattern of functions accepting other functions as inputs and
>passing additional ... arguments to them is prevalent throughout
>the R ecosystem. Currently, however, all such functions must one
>way or another tackle the problem of inadvertently passing arguments
>meant to go to
2010 May 06
1
R on kdeedu-svn library problem
...39;
$SOURCES/kdeedu/cantor/src/backends/R/rserver/rserver.cpp:152: undefined
reference to `Rf_protect'
$SOURCES/kdeedu/cantor/src/backends/R/rserver/rserver.cpp:153: undefined
reference to `R_NilValue'
$SOURCES/kdeedu/cantor/src/backends/R/rserver/rserver.cpp:153: undefined
reference to `SET_TAG'
$SOURCES/kdeedu/cantor/src/backends/R/rserver/rserver.cpp:154: undefined
reference to `SETCAR'
$SOURCES/kdeedu/cantor/src/backends/R/rserver/rserver.cpp:164: undefined
reference to `Rf_allocVector'
$SOURCES/kdeedu/cantor/src/backends/R/rserver/rserver.cpp:164: undefined
reference to...
2008 Apr 29
2
Calling R from C - part way there but need a push!
Dear All,
I've read the manual on "Writing R Extensions" and in particular the
part on calling R from C. (Most of the manual is about calling C
from R, not the other way around.)
The good news is that I can now call _some_ R from C, specifically
the R functions which have C header files. However it isn't clear to
me how to call R functions that are written in R. I
2015 Oct 30
0
match.call enhancements in 3.2.2
...parameter:
> fun_gpar(b = ..1, ..2, 4)
The dot substitution happens in `subDots` in `main/src/unique.c at 1228` (in 3.2.2 sources available as of today in CRAN).? Here is a snippet from that function:
>??? for(a = dots, b = rval, i = 1; i <= len; a = CDR(a), b = CDR(b), i++) {
>??? ??? SET_TAG(b, TAG(a));
>??? ??? t = CAR(a);
>??? ??? while (TYPEOF(t) == PROMSXP)
>??? ??? ??? t = PREXPR(t);
>??? ??? if( isSymbol(t) || isLanguage(t) )
>??? ??? ??? SETCAR(b, installDDVAL(i));?? // <-- HERE
>??? ??? else
>??? ??? ??? SETCAR(b, t);
>??? }
The `installDDVAL(i)` gen...
2020 Jun 30
0
Build a R call at C level
....
Not sure if that is the best way, but works.
call_to_sum <- inline::cfunction(
language = "C",
sig = c(x = "SEXP"), body = "
SEXP e = PROTECT(lang2(install(\"sum\"), x));
SEXP r_true = PROTECT(CONS(ScalarLogical(1), R_NilValue));
SETCDR(CDR(e), r_true);
SET_TAG(CDDR(e), install(\"na.rm\"));
Rf_PrintValue(e);
SEXP ans = PROTECT(eval(e, R_GlobalEnv));
UNPROTECT(3);
return ans;
")
call_to_sum(c(1L,NA,3L))
On Tue, Jun 30, 2020 at 10:08 AM Morgan Morgan
<morgan.emailbox at gmail.com> wrote:
>
> Hi All,
>
> I was reading the...
2020 Jun 30
0
Build a R call at C level
...e::cfunction(
> > language = "C",
> > sig = c(x = "SEXP"), body = "
> >
> > SEXP e = PROTECT(lang2(install(\"sum\"), x));
> > SEXP r_true = PROTECT(CONS(ScalarLogical(1), R_NilValue));
> > SETCDR(CDR(e), r_true);
> > SET_TAG(CDDR(e), install(\"na.rm\"));
> > Rf_PrintValue(e);
> > SEXP ans = PROTECT(eval(e, R_GlobalEnv));
> > UNPROTECT(3);
> > return ans;
> >
> > ")
> >
> > call_to_sum(c(1L,NA,3L))
> >
> > On Tue, Jun 30, 2020 at 10:08 AM Morgan...
2010 Sep 08
0
Correction to vec-subset speed patch
...SET_VECTOR_ELT(result, i, VECTOR_ELT(x, ii));
+ break;
+ case LISTSXP:
/* cannot happen: pairlists are coerced to lists */
- case LANGSXP:
- if (0 <= ii && ii < nx && ii != NA_INTEGER) {
- tmp2 = nthcdr(x, ii);
- SETCAR(tmp, CAR(tmp2));
- SET_TAG(tmp, TAG(tmp2));
- }
- else
- SETCAR(tmp, R_NilValue);
- tmp = CDR(tmp);
- break;
- case RAWSXP:
- if (0 <= ii && ii < nx && ii != NA_INTEGER)
- RAW(result)[i] = RAW(x)[ii];
- else
- RAW(result)[i] = (Rbyte) 0;
- break;
- default:
- errorcall...
2003 May 02
2
Suppressing Scientific Notation
...) { /* IFF less space : "F"(Fixpt) fmt */
diff -r R-1.7.0/src/main/options.c R-1.7.0.mod/src/main/options.c
52a53
> * "scipen"
136a138,140
> int GetOptionSciPen(SEXP rho) {
> return asInteger(GetOption(install("scipen"), rho));
> }
235a240,243
> SET_TAG(v, install("scipen"));
> SETCAR(v, ScalarInteger(0));
> v = CDR(v);
>
374a383,386
> else if (streql(CHAR(namei), "scipen")) {
> k = asInteger(argi);
> SET_VECTOR_ELT(value, i, SetOption(tag, ScalarInteger(k)));
> }
diff -r R-1.7.0/src/...