search for: singlestring

Displaying 2 results from an estimated 2 matches for "singlestring".

2013 Apr 26
1
RFC: R_data_class as part of the C-API
Hi, In src/attrib.c, the comment for the function R_data_class is: ``` /* the S4-style class: for dispatch required to be a single string; for the new class() function; if(!singleString) , keeps S3-style multiple classes. Called from the methods package, so exposed. */ SEXP R_data_class(SEXP obj, Rboolean singleString) ``` I am obviously writing this because I'd wish to see it in the API, and I think that the above (a package shipped with R does need this as part of the...
2007 Apr 10
1
list/matrix chimera
...de is simply incorrect. Nevertheless, I wonder if R_data_class in attrib.c should be a bit more discriminating and only return matrix or array for atomic vectors. Perhaps something like this: --- a/src/main/attrib.c +++ b/src/main/attrib.c @@ -536,7 +536,7 @@ SEXP R_data_class(SEXP obj, Rboolean singleString) if(n == 0) { SEXP dim = getAttrib(obj, R_DimSymbol); int nd = length(dim); - if(nd > 0) { + if(nd > 0 && isVectorAtomic(obj)) { if(nd == 2) klass = mkChar("matrix"); else Here is an example that illus...