[R] R C API Resize matrix

Morgan Morgan morg@n@em@||box @end|ng |rom gm@||@com
Wed Jun 12 16:00:08 CEST 2019


Hi,

Is there a way to resize a matrix defined as follows:

SEXP a = PROTECT(allocMatrix(INTSXP, 10, 2));
int *pa  = INTEGER(a)

To row = 5 and col = 1 or do I have to allocate a second matrix "b" with
pointer *pb and do a "for" loop to transfer the value of a to b?

Thank you
Best regards
Morgan

	[[alternative HTML version deleted]]



More information about the R-help mailing list