[Rd] Comparing dimensions in arrays?
Spencer Graves
spencer.graves at pdf.com
Sun Jul 6 18:47:37 CEST 2008
What functions exist to compare dimensions of arrays, other than
the obvious checks of 'dim' and 'dimnames'?
I ask, because I'm about to write something like this for the
'fda' package, and I'd prefer to use something that is already available.
Specifically, I'm thinking of the following:
checkDim(x, y, xdim=1, ydim=1, defaultNames, subset=c('xiny',
'yinx', 'either', 'neither'), ndimsMismatch = c('xiny', 'yinx',
'either', 'neither') )
This would return list(xout, yout) where dimension 'xdim' of
'xout' would match dimension 'ydim' of 'yout', and both would have
identical dimnames. If defaultNames = FALSE, it would throw an error if
the corresponding dimnames of 'x' and 'y' did not match.
Comments?
Thanks,
Spencer Graves
More information about the R-devel
mailing list