search for: primval

Displaying 20 results from an estimated 24 matches for "primval".

2019 Apr 05
2
patch to improve matrix conformability error message
...y.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/array.c b/src/main/array.c index 4b95e33..cedf627 100644 --- a/src/main/array.c +++ b/src/main/array.c @@ -1350,15 +1350,18 @@ SEXP attribute_hidden do_matprod(SEXP call, SEXP op, SEXP args, SEXP rho) if (PRIMVAL(op) == 0) { /* primitive, so use call */ if (ncx != nry) - errorcall(call, _("non-conformable arguments")); + errorcall(call, _("non-conformable arguments of dimension (%d, %d) and (%d, %d)"), + nrx, ncx, nry, ncy); } else if (PRIMVAL(op) == 1) { if (n...
2009 Feb 22
4
'unique' error message is printed despite silent=TRUE (PR#13547)
In 2.8.0/Windows Vista: When 'unique' gives a type error message, it prints out even if errors are being caught: > try(unique(quote(hello)),silent=TRUE) hello This comes from the .Internal unique routine: > try(.Internal(unique(quote(hello),NULL,NULL)),silent=TRUE) hello I guess it is using the internal equivalent of print rather than the internal equivalent of stop.
2019 Apr 30
0
patch to improve matrix conformability error message
...anged, 6 insertions(+), 3 deletions(-) > >diff --git a/src/main/array.c b/src/main/array.c >index 4b95e33..cedf627 100644 >--- a/src/main/array.c >+++ b/src/main/array.c >@@ -1350,15 +1350,18 @@ SEXP attribute_hidden do_matprod(SEXP call, SEXP op, SEXP args, SEXP rho) > if (PRIMVAL(op) == 0) { > /* primitive, so use call */ > if (ncx != nry) >- errorcall(call, _("non-conformable arguments")); >+ errorcall(call, _("non-conformable arguments of dimension (%d, %d) and (%d, %d)"), >+ nrx, ncx, nry, ncy); > } > else if...
2008 Feb 27
1
Warnings generated by log2()/log10() are really large/takes a long time to display
x <- rnorm(1e6); y <- log(x); # or logb(x) or log1p(x) w <- warnings(); print(object.size(w)); ## [1] 480 str(w); $ NaNs produced: language log(x) - attr(*, "dots")= list() - attr(*, "class")= chr "warnings" y <- log2(x); # or log10(x) w <- warnings(); print(object.size(w)); ## [1] 8000536 str(w); ## List of 1 ## $ NaNs produced: language
2016 Jan 04
1
deparse with parentheses for SUBSET
...04 16:15:09.000000000 +0100 @@ -971,7 +971,11 @@ print2buff(")", d); break; case PP_SUBSET: + if ((parens = needsparens(fop, CAR(s), 1))) + print2buff("(", d); deparse2buff(CAR(s), d); + if (parens) + print2buff(")", d); if (PRIMVAL(SYMVALUE(op)) == 1) print2buff("[", d); else With this applied, the output is more consistent: > substitute(a[1], list(a = quote(x * y))) (x * y)[1] > substitute(a$b, list(a = quote(x * y))) (x * y)$b Best Regards, Lukas Stadler
2004 Nov 02
0
how to call function in ../src/main
...orks fine. But it looks not for calling functions in R/R-1.9.1/src/main We want to correlation only, so we copy cov.c to cor.c where use cor ( int n, double *x, double *y, double *ans ) { Rboolean cor, kendall, pair, na_fail, sd_0; int ansmat, method, ncx, ncy; /* compute correlations if PRIMVAL(op) == 0, covariances if PRIMVAL(op) != 0 */ cor = 0; ansmat = 0; ncx = 1; ncy = 1; pair = TRUE; kendall = FALSE; cov_pairwise2(n, ncx, ncy, x, y, ans, &sd_0, cor, kendall); } replace SEXP do_cov(SEXP call, SEXP op, SEXP args, SEXP...
2019 May 26
2
rbind has confusing result for custom sub-class (possible bug?)
...herwise we immediately drop through to the default code. It's not clear what #2 means -- an applicable method *for what*? Glancing at the source code would suggest it's looking for rbind.IDate: https://github.com/wch/r-source/blob/trunk/src/main/bind.c#L1051-L1063 const char *generic = ((PRIMVAL(op) == 1) ? "cbind" : "rbind"); // should be rbind here const char *s = translateChar(STRING_ELT(classlist, i)); // iterating over the classes, should get to IDate first sprintf(buf, "%s.%s", generic, s); // should be rbind.IDate but adding this method (or even export...
2020 May 22
0
round() and signif() do not check argument names when a single argument is given
...ctions are handled in a handler function in src/main/arithmetic.c: do_Math2(). The strange cases get handled by the code around line 1655 in src/main/arithmetic.c. The context is n is the number of arguments, but symbol names have not yet been checked: if(n == 1) { double digits = 0.0; if(PRIMVAL(op) == 10004) digits = 6.0; SETCDR(args, CONS(ScalarReal(digits), R_NilValue)); } Here, 10004 is the opcode symbol for signif and 10001 is for round, but these are the only two ops handled by this function, so round uses digits=0.0. The SETCDR creates the argument list to be the current 1-item...
1998 Sep 22
1
"Segmentation Fault - core dumped" in R 0.62.3
I am occasional getting "Segmentation Fault - core dumped" in R 0.62.3 (I think more often then I did in 0.62.2). I have not been able to do this in any reliably reproducible way yet, but thought I would mention the problem in case some else can isolate it. Paul Gilbert -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read
2019 May 26
2
rbind has confusing result for custom sub-class (possible bug?)
...> > It's not clear what #2 means -- an applicable method *for what*? Glancing > > at the source code would suggest it's looking for rbind.IDate: > > > > https://github.com/wch/r-source/blob/trunk/src/main/bind.c#L1051-L1063 > > > > const char *generic = ((PRIMVAL(op) == 1) ? "cbind" : "rbind"); // should > > be rbind here > > const char *s = translateChar(STRING_ELT(classlist, i)); // iterating over > > the classes, should get to IDate first > > sprintf(buf, "%s.%s", generic, s); // should be rbind.IDate...
2001 Feb 17
4
Comments on R-1.2.1 builds (PR#851)
...--------------------------- c89 -I. -I../../src/include -I../../src/include -I/usr/local/include -DHAVE_CONFIG_H -OPT:IEEE_NaN_inf=ON -g -c arithmetic.c -o arithmetic.o cc-1185 c89: WARNING File = arithmetic.c, Line = 505 An enumerated type is mixed with another type. x = complex_binary(PRIMVAL(op), x, y); ^ cc-1185 c89: WARNING File = arithmetic.c, Line = 511 An enumerated type is mixed with another type. x = real_binary(PRIMVAL(op), x, y); ^ cc-1185 c89: WARNING File = arithmetic.c, Line = 514 An enumerated type i...
2019 May 27
2
rbind has confusing result for custom sub-class (possible bug?)
...method *for what*? > Glancing > > > > at the source code would suggest it's looking for rbind.IDate: > > > > > > > > > https://github.com/wch/r-source/blob/trunk/src/main/bind.c#L1051-L1063 > > > > > > > > const char *generic = ((PRIMVAL(op) == 1) ? "cbind" : "rbind"); // > should > > > > be rbind here > > > > const char *s = translateChar(STRING_ELT(classlist, i)); // > iterating over > > > > the classes, should get to IDate first > > > > sprintf(buf, "...
2006 Feb 22
2
How can I see how %*% is implemented?
I would like to see how the matrix multiplication operator %*% is implemented (because I want to see which external Fortran/C routines are used). How can I do so? Best S??ren
1999 May 11
1
another multivariate ts bug
I think this is another one of the same kind of bugs in ts: Version 0.64.1 (May 8, 1999) ... > z <- ts(matrix(1:20,10,2), start=c(1969,1), frequency=12) > (z > 5) | (z < 2) Error: invalid time series parameters specified > Paul -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read
2003 Jan 29
1
The function 'any' (PR#2503)
Full_Name: Paul Louisell Version: 1.6.2 OS: Windows NT Submission from: (NULL) (192.249.47.9) There is a slight bug in the function 'any'. Given a logical vector (possibly including values of 'NA'), the default action of any should be as follows: (i) at least one value = T should return T (ii) NO values = T (a) at least one value = 'NA' should return 'NA'
2019 May 26
0
rbind has confusing result for custom sub-class (possible bug?)
...ugh to the default code. > > It's not clear what #2 means -- an applicable method *for what*? Glancing > at the source code would suggest it's looking for rbind.IDate: > > https://github.com/wch/r-source/blob/trunk/src/main/bind.c#L1051-L1063 > > const char *generic = ((PRIMVAL(op) == 1) ? "cbind" : "rbind"); // should > be rbind here > const char *s = translateChar(STRING_ELT(classlist, i)); // iterating over > the classes, should get to IDate first > sprintf(buf, "%s.%s", generic, s); // should be rbind.IDate > > but addin...
2019 Jun 02
1
rbind has confusing result for custom sub-class (possible bug?)
...t;> > > > at the source code would suggest it's looking for rbind.IDate: > >> > > > > >> > > > https://github.com/wch/r-source/blob/trunk/src/main/bind.c#L1051-L1063 > >> > > > > >> > > > const char *generic = ((PRIMVAL(op) == 1) ? "cbind" : "rbind"); // should > >> > > > be rbind here > >> > > > const char *s = translateChar(STRING_ELT(classlist, i)); // iterating over > >> > > > the classes, should get to IDate first > >> > &gt...
2001 Sep 27
1
Passing an R matrix to a C program
Hello, I'm starting to write a C function that gets a list and a matrix from R. I'm using .Call because I've undertood that this is recommended to handle lists (am I wrong?). My problem is that I can pass the matrix as a vector, but not as a 2D array. For example, in the following simple C program: #include <R.h> #include <Rdefines.h> SEXP printListElement(SEXP list,
2019 May 27
0
rbind has confusing result for custom sub-class (possible bug?)
...ear what #2 means -- an applicable method *for what*? Glancing > > > at the source code would suggest it's looking for rbind.IDate: > > > > > > https://github.com/wch/r-source/blob/trunk/src/main/bind.c#L1051-L1063 > > > > > > const char *generic = ((PRIMVAL(op) == 1) ? "cbind" : "rbind"); // should > > > be rbind here > > > const char *s = translateChar(STRING_ELT(classlist, i)); // iterating over > > > the classes, should get to IDate first > > > sprintf(buf, "%s.%s", generic, s); // s...
2002 May 22
4
Re: assigning with operator '='.
I've just checked out Jens Oehlschlgel's posting as regards assigning with the ``='' operator. Yep, the phenomenon described really does happen. And yep, it sure seems ***very*** dangerous to me. Mind you, using ``='' as the assignment operator strikes me as being dangerous anyhow. Bad design decision by the S people (by John Chambers?) and R should ***not*** have