search for: rf_nrows

Displaying 5 results from an estimated 5 matches for "rf_nrows".

2014 Mar 31
1
C API to get numrow of data frame
...ame() n<- nrow(x) print(n) 0 Example : My C function which deals with data frame looks like and I don't to send the number of rows of data frame .I want to detect it from the function itself, my function take data frame as argument and do some on it. I want API equivalent to nrow. I tried Rf_nrows,Rf_ncols . No much help. SEXP writeRR(SEXP dataframe) { } Any help is very appreciated. Thanks, Sandip [[alternative HTML version deleted]]
2020 Sep 11
4
Garbage collection of seemingly PROTECTed pairlist
...* nr]; } } UNPROTECT(1); return out;} SEXP C_make_len2_int_vec(int first, int second) { SEXP out = PROTECT(Rf_allocVector(INTSXP, 2)); int *out_int = INTEGER(out); out_int[0] = first; out_int[1] = second; UNPROTECT(1); return out;} SEXP C_fullocate(SEXP int_mat) { int nr = Rf_nrows(int_mat), *int_mat_int = INTEGER(int_mat); int last, row_num; // row_num will be 1-indexed SEXP prlst0cdr = PROTECT(C_int_mat_nth_row_nrnc(int_mat_int, nr, 2, 1)); SEXP prlst = PROTECT(Rf_list1(prlst0cdr)); SEXP prlst_tail = prlst; last = INTEGER(prlst0cdr)[1]; row_num = 2; while (ro...
2009 Mar 27
0
imporving performance of slicing on matrices and S4 their derivatives
...umn of a matrix to use instead of [-operator ## (same performance gains if index is a character or on multiple columns or ## when getting multiple columns as matrix and assigning the names from input) body = "/* test for column extraction: no checks here for code simplicity */ int nrow = Rf_nrows(m); int i = INTEGER(index)[0] - 1; SEXP res; PROTECT(res = allocVector(REALSXP, nrow)); memcpy(REAL(res), &(REAL(m)[i*nrow]), nrow*sizeof(double)); UNPROTECT(1); return res;" mcol = cfunction(signature(m="matrix", index="integer"), body=body,...
2020 Sep 12
0
Garbage collection of seemingly PROTECTed pairlist
...> SEXP C_make_len2_int_vec(int first, int second) { > SEXP out = PROTECT(Rf_allocVector(INTSXP, 2)); > int *out_int = INTEGER(out); > out_int[0] = first; > out_int[1] = second; > UNPROTECT(1); > return out;} > > SEXP C_fullocate(SEXP int_mat) { > int nr = Rf_nrows(int_mat), *int_mat_int = INTEGER(int_mat); > int last, row_num; // row_num will be 1-indexed > SEXP prlst0cdr = PROTECT(C_int_mat_nth_row_nrnc(int_mat_int, nr, 2, 1)); > SEXP prlst = PROTECT(Rf_list1(prlst0cdr)); > SEXP prlst_tail = prlst; > last = INTEGER(prlst0cdr)[1]; &...
2002 Jul 11
1
dyn.load tcl/tk (PR#1774)
...-L/soft/readline/v4.2.1/lib -o mva.so dblcen.o distance.o hclust-utils.o init.o hclust.o kmns.o -L/soft/readline/v4.2.1/lib -lreadline -ltermcap -lm -lUfor -lfor -lFutil -lots -lm_c32 -lmld -lexc ld: Warning: Unresolved: R_NaReal R_finite Rf_error machar R_alloc Rf_coerceVector Rf_allocMatrix Rf_nrows Rf_protect Rf_unprotect LENGTH INTEGER R_registerRoutines mkdir -p -- ../../../../library/mva/libs gmake[5]: Leaving directory `/soft/R/R-1.5.1/src/library/mva/src' gmake[4]: Leaving directory `/soft/R/R-1.5.1/src/library/mva/src' gmake[3]: Leaving directory `/soft/R/R-1.5.1/src/library/mva...