search for: islanguag

Displaying 5 results from an estimated 5 matches for "islanguag".

Did you mean: islanguage
2006 Oct 15
1
Feature request: names(someEnv) same as ls(someEnv)
Hi, I would be nice if names() returned the equivalent of ls() for environments. --- a/src/main/attrib.c +++ b/src/main/attrib.c @@ -687,6 +687,8 @@ SEXP attribute_hidden do_names(SEXP call s = CAR(args); if (isVector(s) || isList(s) || isLanguage(s)) return getAttrib(s, R_NamesSymbol); + if (isEnvironment(s)) + return R_lsInternal(s, 0); return R_NilValue; } + seth -- Seth Falcon | Computational Biology | Fred Hutchinson Cancer Research Center http://bioconductor.org
2017 Apr 30
1
`match.call` and dots substitution
...uage, they get substituted by `..n` where `n` is the position in dots. When they are scalars they are substituted with the scalar. It appears this is done in 'R-3.4.0:src/main/unique.c at 1319' in `subDots`: while (TYPEOF(t) == PROMSXP) t = PREXPR(t); if( isSymbol(t) || isLanguage(t) ) SETCAR(b, installDDVAL(i)); else SETCAR(b, t); I'm not sure why it is necessary to use `installDDVAL`, which creates the `..n` symbols, instead of duplicating the language object and attaching that to the matched call. Certainly from a user perspective I would prefer to...
2015 Oct 30
0
match.call enhancements in 3.2.2
...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)` generates the `..X` symbols.? I'm sure there is a very good reason why this is done, but then it does lead to the issues above. Am I just doing some...
2010 Sep 08
0
Correction to vec-subset speed patch
...SEXP s, int *stretch, SEXP call) +SEXP attribute_hidden makeSubscript(SEXP x, SEXP s, int *stretch, SEXP call, + int used_to_replace) { - int nx; - SEXP ans; + int nx, ns; + SEXP ans, tmp; - ans = R_NilValue; - if (isVector(x) || isList(x) || isLanguage(x)) { - nx = length(x); - - ans = vectorSubscript(nx, s, stretch, getAttrib, (STRING_ELT), - x, call); - } - else { + if (!isVector(x) && !isList(x) && !isLanguage(x)) { ECALL(call, _("subscripting on non-vector")); + return R_NilValue; } -...
2003 Sep 02
8
I don't understand this
For reasons which I'll spare you, I'm writing a program to analyse R source code. This has led me to probe some of the darker corners of R syntax to find out what is supposed to happen. Now, from reading the R documentation (and the New S book &c) I know perfectly well that f(a, b, etc) <- x is supposed to turn into a <- "f<-"(a, b, etc, value=x) Except,