[Rd] bypassing SET_DIM checking

Seth Falcon sfalcon at fhcrc.org
Sun Aug 13 18:58:43 CEST 2006


"miguel manese" <jjonphl at gmail.com> writes:

> Hello,
>
> I created an S3 "type" w/c is actually a list that should look like a
> matrix but whose data is actually in an external file. The SEXP just
> contains info on how to retrieve the data from the file. When I get to
> the part of creating the SEXP, I found out that SET_DIM & SET_DIMNAME
> checks the SEXP if the length matches (somewhere in src/main/attrib.c,
> dimgets & dimnamegets IIRC (it's on my other partition. life sucks)).
> After a quick look at the R code, I tried to bypass them by doing:

If you want to emulate a matrix-like object you might want to look
at the Matrix package which does uses S4 classes to represent
matrices.

I don't think the class systems are fully functional at the C-level of
R; macros like SET_DIM don't do dispatch beyond the built-in SEXP
types.

+ seth



More information about the R-devel mailing list