search for: type2char

Displaying 12 results from an estimated 12 matches for "type2char".

2006 Nov 07
1
Getting the name of a SEXP type in package code?
Hi, Is there an alternative to type2char that is available for use in package code? It would be useful for producing more informative error messages. + seth
2017 Feb 20
1
another fix for R crashes under enable-strict-barrier, lto, trunk@72156
...const char *(R_CHAR)(SEXP x) { + if(!x) + error("de-referncing null. Check the validity of your data."); if(TYPEOF(x) != CHARSXP) error("%s() can only be applied to a '%s', not a '%s'", "CHAR", "CHARSXP", type2char(TYPEOF(x))); The segfault happens in the middle of tests/no-segfault.R . I have since built R 3.2.x and 3.3.x with --enable-strict-barrier so this is probably new to R 3.4. I think tests/no-segfault.R is supposed to try to trigger a segfault with invalid data, and it is supposed to be caught. T...
2009 Aug 07
1
Bug in nlm, found using sem; failure in several flavors (PR#13881)
...t;- sem(ram=ice.ram, S=ice.S, N=ice.N) ...at this point, any number of problems could occur. I have seen the following. 1) Simple lack of convergence. (might be my model's fault.) 2) Error in nlm(if (analytic.gradient) objective.2 else objective.1, start, : type 31 is unimplemented in 'type2char' 3) *** caught segfault *** address 0xc019c87b, cause 'memory not mapped' Traceback: 1: nlm(if (analytic.gradient) objective.2 else objective.1, start, hessian = TRUE, iterlim = maxiter, print.level = if (debug) 2 else 0, typsize = typsize, ...) 2: sem.default(ram = ram, S = S, N...
2017 Feb 11
1
another fix for R crashes under enable-strict-barrier, lto, trunk@72156
...G_VEC)(SEXP x) { return IS_LONG_VEC(CHK2(x)); } const char *(R_CHAR)(SEXP x) { - if(TYPEOF(x) != CHARSXP) + if(x && (TYPEOF(x) != CHARSXP)) error("%s() can only be applied to a '%s', not a '%s'", "CHAR", "CHARSXP", type2char(TYPEOF(x))); return (const char *)CHAR(x); It is a fairly obvious fix to a bug since include/Rinternals.h:#define TYPEOF(x) ((x)->sxpinfo.type) and it was trying to de-reference "0->sxpinfo.type" (under --enable-strict-barrier I think). So there. While I subscribe to R-d...
2008 Apr 19
1
Error: value of 'SET_CXTAIL' must be a char or NULL, not a 'char'
Dear List On windows XP using R.2.6.2 I get the message Error: value of 'SET_CXTAIL' must be a char or NULL, not a 'char' in connection with calling C code (using the .Call interface). I have been unable to find any info on this (in Writing R extensions). Can anyone help me with understanding this error? (In case it helps in tracking the problem: I pass two matrices and a
2009 Aug 07
0
Bug in nlm, found using sem; failure in several flavors (PR#13882)
...t; > ...at this point, any number of problems could occur. I have seen the > following. > > 1) Simple lack of convergence. (might be my model's fault.) > 2) Error in nlm(if (analytic.gradient) objective.2 else objective.1, star= t, > : > =A0 type 31 is unimplemented in 'type2char' > 3) =A0*** caught segfault *** > address 0xc019c87b, cause 'memory not mapped' > > Traceback: > =A01: nlm(if (analytic.gradient) objective.2 else objective.1, start, > hessian =3D TRUE, iterlim =3D maxiter, print.level =3D if (debug) 2 else = 0, > typsize =3D typs...
2009 Aug 07
1
Bug in nlm, found using sem; failure in several flavors (PR#13883)
..., any number of problems could occur. I have seen the >> following. >> >> 1) Simple lack of convergence. (might be my model's fault.) >> 2) Error in nlm(if (analytic.gradient) objective.2 else objective.1, sta= rt, >> : >> =A0 type 31 is unimplemented in 'type2char' >> 3) =A0*** caught segfault *** >> address 0xc019c87b, cause 'memory not mapped' >> >> Traceback: >> =A01: nlm(if (analytic.gradient) objective.2 else objective.1, start, >> hessian =3D TRUE, iterlim =3D maxiter, print.level =3D if (debug) 2 else=...
2011 Aug 14
0
Improved version of Rprofmem
...; length >= R_MemReportingNElem) { + if (R_MemReportingOutfile != NULL) { + if (R_MemDetailsReporting) + fprintf (R_MemReportingOutfile, "%lu (%s %lu):", + (unsigned long) size, + type==intCHARSXP ? "char" : type2char(type), + (unsigned long) length); + else + fprintf (R_MemReportingOutfile, "%lu :", + (unsigned long) size); + } + if (R_MemReportingToTerminal) { + if (R_MemDetailsReporting) + Rprintf...
2013 Apr 09
2
Behaviors of diag() with character vector in R 3.0.0
Dear all, According to CHANGES IN R 3.0.0: o diag() as used to generate a diagonal matrix has been re-written in C for speed and less memory usage. It now forces the result to be numeric in the case diag(x) since it is said to have 'zero off-diagonal entries'. diag(x) does not work for character vector in R 3.0.0 any more. For example, v <- c("a",
2010 Sep 08
0
Correction to vec-subset speed patch
...} - 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(call, R_MSG_ob_nonsub, type2char(mode)); - } + case LANGSXP: + for (i = 0; i<n; i++) { + if ((ii=INTEGER(indx)[i]) == NA_INTEGER || --ii < 0 || ii >= nx) + SETCAR(tmp, R_NilValue); + else { + tmp2 = nthcdr(x, ii); + SETCAR(tmp, CAR(tmp2)); +...
2007 Apr 24
0
R 2.5.0 is released
...ool' knows how to do so. o Building R as a shared library and standalone nmath now installs pkg-config files 'libR.pc' and 'libRmath.pc' respectively. o Added test for insufficiently complete implementation of sigaction. C-LEVEL FACILITIES o Functions str2type, type2char and type2str are now available in Rinternals.h. o Added support for Objective C in R and packages (if available). o R_ParseVector() has a new 4th argument 'SEXP srcfile' allowing source references to be attached to the returned expression list. o Added ptr_R_WriteConsoleEx...
2007 Apr 24
0
R 2.5.0 is released
...ool' knows how to do so. o Building R as a shared library and standalone nmath now installs pkg-config files 'libR.pc' and 'libRmath.pc' respectively. o Added test for insufficiently complete implementation of sigaction. C-LEVEL FACILITIES o Functions str2type, type2char and type2str are now available in Rinternals.h. o Added support for Objective C in R and packages (if available). o R_ParseVector() has a new 4th argument 'SEXP srcfile' allowing source references to be attached to the returned expression list. o Added ptr_R_WriteConsoleEx...