search for: r_missingarg

Displaying 20 results from an estimated 22 matches for "r_missingarg".

2010 Aug 21
1
Speed improvement to evalList
...h); if (mode==0) { head = ev; mode = 1; } else { SETCDR(tail, ev); } tail = ev; h = CDR(h); } } else if (h != R_MissingArg) error(_("'...' used in an incorrect context")); } else if (CAR(el) == R_MissingArg) { /* It was an empty element: most likely get here from evalArgs which may have been called on part of the args. */ errorcall(call, _("argument %d is empty"), n); }...
2020 Jun 23
1
mget(missingArgument)?
Currently, when mget() is used to get the value of a function's argument with no default value and no value in the call it returns the empty name (R_MissingArg). Is that the right thing to do or should it return 'ifnotfound' or give an error? E.g., > a <- (function(x) { y <- "y from function's environment"; mget(c("x","y","z"), envir=environment(), ifnotfound=666)})() > str(a) List of 3 $...
2002 May 01
1
compiling R-1.5.0, package methods, on Solaris 5.7
....] gcc -I../../../../include -I/usr/local/include -fPIC -g -O2 -c slot.c -o slo t.o gcc -G -o methods.so do_substitute_direct.o methods_list_dispatch.o method_met a_data.o slot.o dumping R code in package 'methods' initializing class and method definitions now ...Error in .Call("R_missingArg", if (eval) symbol else substitute(symbol), : .Call function name not in load table Execution halted *** Error code 1 make: Fatal error: Command failed for target `../../../library/methods/R/all.rda' [...] -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-....
2017 Jan 04
4
seq.int/seq.default
On 1/4/17 1:26 AM, Martin Maechler wrote: >>>>>> Mick Jordan <mick.jordan at oracle.com> >>>>>> on Tue, 3 Jan 2017 07:57:15 -0800 writes: > > This is a message for someone familiar with the implementation. > > Superficially the R code for seq.default and the C code for seq.int > > appear to be semantically very
2014 Mar 06
1
Create dataframe in C from table and return to R
...Char("int")); SET_STRING_ELT(lsnm,1,mkChar("string")); for ( i = 0 ; i < 3; i++ ) { SET_STRING_ELT(dfStr,i,mkChar(ab[i])); INTEGER(dfint)[i] = sn[i]; } SET_VECTOR_ELT(df,0,dfint); SET_VECTOR_ELT(df,1,dfStr); setAttrib(df,R_NamesSymbol,lsnm); //PROTECT(dfm=LCONS(dfm,list3(dfm,R_MissingArg,mkFalse()))); UNPROTECT(4); dfm = PROTECT(lang2(install("data.frame"),df)); SEXP res = PROTECT(eval(dfm,R_GlobalEnv)); UNPROTECT(2) } ------------------------------------------------------------------------ It works fine but i want it the other way the output is print(result) int...
2008 Oct 24
1
changed behaviour of 'get' in 2.8.0: request for unchange
There is an unannounced and non-backwards-compatible change to the behaviour of 'get' in R2.8.0. 'get'ting a missing value now causes an error, whereas hitherto it's just returned a "missing" object. For example, in R2.8.0 this happens: test> getto <- function( x) get( 'x', sys.frame(1)) test> getto() Error in get("x", sys.frame(1)) :
2020 May 22
0
round() and signif() do not check argument names when a single argument is given
...s essentially the same guard used in other functions like do_log_bulitin that is in the same file. if(n == 1 ){ static SEXP R_x_Symbol = NULL; R_x_Symbol = install("x"); /*This handles single-argument calling*/ /*Make sure we don't call it with a mis-named argument:*/ if(CAR(args)==R_MissingArg || TAG(args) != R_NilValue && TAG(args) != R_x_Symbol) error(_("argument \"%s\" is missing, with no default"), "x"); double digits = 0.0; if(PRIMVAL(op) == 10004) digits = 6.0; SETCDR(args, CONS(ScalarReal(digits), R_NilValue)); } I'm not sure...
2003 Jun 06
1
Problerm building R-1.7.0 on OpenBSD3.2/sparc64
...#39; /home/test/proj/downl/R-1.7.0/bin/R.bin: /home/test/proj/downl/R-1.7.0/library/m ethods/libs/methods.so: can't resolve reference 'R_NamesSymbol' /home/test/proj/downl/R-1.7.0/bin/R.bin: /home/test/proj/downl/R-1.7.0/library/m ethods/libs/methods.so: can't resolve reference 'R_MissingArg' /home/test/proj/downl/R-1.7.0/bin/R.bin: /home/test/proj/downl/R-1.7.0/library/m ethods/libs/methods.so: can't resolve reference 'R_NilValue' /home/test/proj/downl/R-1.7.0/bin/R.bin: /home/test/proj/downl/R-1.7.0/library/m ethods/libs/methods.so: can't resolve reference 'R_...
2009 Sep 29
3
How do I access class slots from C?
...nv, NULL)); // creating a portfolioData object PROTECT(e=lang4(install("c"),mkString("SBI"),mkString("SPI"),mkString("SII"))); PROTECT(tsAssets=R_tryEval(e,R_GlobalEnv,NULL)); PROTECT(e=lang4(install("["),install("SWX.RET"),R_MissingArg,tsAssets)); PROTECT(tsReturns=R_tryEval(e,R_GlobalEnv,NULL)); PROTECT(e=lang3(install("*"),ScalarInteger(100),tsReturns)); PROTECT(tsReturns=R_tryEval(e,R_GlobalEnv,NULL)); PROTECT(e=lang3(install("portfolioData"),tsReturns,portSpec)); PROTECT(portData=R_tr...
2023 Nov 15
1
saveRDS()/readRDS() on environments
Dear r-devel, I was surprised to see that saveRDS() and readRDS() work quite well with environments, see below: ``` z <- 3 # in global env y <- new.env() y$a <- 1 x <- new.env(parent = y) x$b <- 2 saveRDS(x, "x.RDS") # in a new session x <- readRDS("x.RDS") y <- parent.env(x) x$b #> [1] 2 y$a #> [1] 1 parent.env(y) #> <environment:
2002 Jan 07
1
Mishandling missing "..." (PR#1247)
R> myfun <- function(x, ...) {x[...] <- 0; x} R> myfun(3) Error in myfun(3) : SubAssignArgs: invalid number of arguments It fails because no ... was passed. The workaround (and desired behavior) is: R> myfun <- function(x, ...) {if (missing(...)) x[] <- 0 else x[...] <- 0; x} R> myfun(3) [1] 0 Deja vu? This is the one piece of my PR#1110 (Oct 3, 2001) that I
2009 Nov 18
1
R_NilValue and segfault.
...to wrap up the R_NilValue into OCaml-R. I nevertheless get a segfault. As I gathered, R_NilValue is declared in Rinternals.h: > /* Special Values */ > LibExtern SEXP R_NilValue; /* The nil object */ > LibExtern SEXP R_UnboundValue; /* Unbound marker */ > LibExtern SEXP R_MissingArg; /* Missing argument marker */ So, in my r_data.c file, I have: -1- an #include directive. > #include <Rinternals.h> -2- the function wrapping R data in OCaml data > CAMLprim value Val_sexp (SEXP sexp) > { > CAMLparam0(); > CAMLlocal1(result); > result = cam...
1997 Apr 09
2
R-alpha: R <-> S compatibility; more demos -- using S-plus validate(..) ..
Look at the result of (in S-plus:) validate(verbose=TRUE, outfile="......./validate-3.4.out") which gives (for me, S-plus 3.4 on Solaris 2.5) 2106 Lines of output. It's full of tests using "standard data sets". (--> 'demos' available!) Basically, at the end of each example, there are statements which should return TRUE if the 'validation test' is
2002 Jan 02
1
Building R-1.4 on Tru64
...eObject Rf_mkChar SET_STRING_ELT Rf_findVar R_UnboundValue VECTOR_ELT R_NamesSymbol Rf_getAttrib Rf_length STRING_ELT R_CHAR R_do_slot Rf_asChar PRINTNAME Rf_isNull CAR CDR R_data_class Rf_isFunction Rf_findFun SETCAR Rf_eval INTEGER CLOENV Rf_findVarInFrame Rf_isSymbol ENCLOS SYMVALUE Rf_asLogical R_MissingArg Rf_isPrimitive do_set_prim_method BODY R_deferred_default_method PREXPR PRENV R_DotsSymbol DDVAL R_set_prim_method Rf_defineVar R_do_slot_assign mkdir ../../../../library/methods/libs make[5]: Leaving directory `/tmp_mnt/net/fire/s/fire/1/richardb/Tru64/src/library/methods/src' make[4]: Leaving...
2002 Jun 20
1
errors installing R-1.5.1 on linux debian
...re just the last few lines of many screenfuls of output, where things seem to be working well 'til...) make[4]: Entering directory `/home/tebaldi/R/R-1.5.1/src/library/methods' dumping R code in package 'methods' initializing class and method definitions now ...Error in .Call("R_missingArg", if (eval) symbol else substitute(symbol), : .Call function name not in load table Execution halted make[4]: *** [../../../library/methods/R/all.rda] Error 1 make[4]: Leaving directory `/home/tebaldi/R/R-1.5.1/src/library/methods' make[3]: *** [all] Error 2 make[3]: Leaving direc...
2009 Dec 10
1
switch() called with just the EXPR argument causes R to hang (PR#14124)
...x) != 1) error(_("switch: EXPR must return a length 1 vector")); PROTECT(w = switchList(CDR(args), rho)); if (isString(x)) { for (y = w; y != R_NilValue; y = CDR(y)) if (TAG(y) != R_NilValue && pmatch(STRING_ELT(x, 0), TAG(y), 1)) { while (CAR(y) == R_MissingArg && y != R_NilValue) y = CDR(y); UNPROTECT(1); return (eval(CAR(y), rho)); } for (y = w; y != R_NilValue; y = CDR(y)) if (TAG(y) == R_NilValue) { UNPROTECT(1); return (eval(CAR(y), rho)); } UNPROTECT(1); return R...
2009 Sep 16
2
I want to get a reference to this time series object
I'm trying to get a reference to this object in C SWX.RET[1:6,c("SBI,"SPI","SII")] While i am able to access and use a plain SWX.RET object, I'm getting confused on how to create an object with the array subscripts like above. Here is what I tried to do. It doesn't work because "[" is obviously not an operation or function on SWX.RET. So how do I
2010 Feb 19
3
Rubbish values written with zero-length vectors (PR#14217)
Full_Name: George Russell Version: 2.10.0, 2.11.0 (2009-12-13 r50716) OS: Windows Submission from: (NULL) (217.111.3.131) R trace: -- cut here -- > v <- integer(0) > v[[1]] <- v > v [1] 20522144 > v <- numeric(0) > v[[1]] <- v > v [1] 4.254131e-314 > sessionInfo() R version 2.10.0 (2009-10-26) i386-pc-mingw32 locale: [1] LC_COLLATE=German_Germany.1252
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
2009 Dec 16
2
What is the fastest way to see what are in an RData file?
Currently, I load the RData file then ls() and str(). But loading the file takes too long if the file is big. Most of the time, I only interested what the variables are in the the file and the attributes of the variables (like if it is a data.frame, matrix, what are the colnames/rownames, etc.) I'm wondering if there is any facility in R to help me avoid loading the whole file.