Skip to content
Back to formatted view

Raw Message

Message-ID: <CAL0QV_NPf1NzMJbscLc3QirJcAfG=Ks9ecXPbykk--kFmT_0fw@mail.gmail.com>
Date: 2019-06-14T21:31:53Z
From: Morgan Morgan
Subject: R C API resize matrix

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]]