search for: set_dimnames

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

Did you mean: get_dimnames
2016 Jun 10
0
collapsing list of NULLs dimnames into a NULL
...s<- do the collapse would fix the problem in one place once for all and avoid a lot of repeated code. Finally, having this functionality available at the C level would be great. Would basically be a wrapper to Rf_setAttrib(x, R_DimNamesSymbol, dimnames) that takes care of the collapse. The SET_DIMNAMES macro could be redefined to call that wrapper instead... Thanks, H. -- Herv? Pag?s Program in Computational Biology Division of Public Health Sciences Fred Hutchinson Cancer Research Center 1100 Fairview Ave. N, M1-B514 P.O. Box 19024 Seattle, WA 98109-1024 E-mail: hpages at fredhutch.org Phon...
2009 Mar 27
0
imporving performance of slicing on matrices and S4 their derivatives
...s */ int nrow = Rf_nrows(m); int ncol = Rf_ncols(m); SEXP res, dim; PROTECT(res = allocVector(REALSXP, nrow*ncol)); PROTECT(dim = allocVector(INTSXP, 2)); INTEGER(dim)[0] = nrow; INTEGER(dim)[1] = ncol; SET_DIM(res, dim); if (GET_DIMNAMES(m)!= R_NilValue) SET_DIMNAMES(res, Rf_duplicate(GET_DIMNAMES(m))); if (ncol>0 && nrow>0) memcpy(REAL(res), REAL(m), nrow*ncol*sizeof(double)); UNPROTECT(2); return res;" mcols = cfunction(signature(m="matrix"), body=body, includes="#include <string.h>") ##...