Re: [R] R C API resize matrice

2019-06-15 Thread Morgan Morgan
trName) { > INTEGER(Rf_getAttrib(x, attrName))[1]=2; > } > ``` > > R code: > ``` > > a=matrix(1:6,2,3) > > I_know_it_is_not_correct(a,as.symbol("dim")) > > a > [,1] [,2] > [1,]13 > [2,]24 > > attributes(a) > $dim >

[R] R C API resize matrice

2019-06-14 Thread Morgan Morgan
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

[R] R C API Resize matrix

2019-06-13 Thread Morgan Morgan
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

[R] Bug in R 3.6.0?

2019-04-30 Thread Morgan Morgan
Hi, I am using the R 3.6.0 on windows. The issue that I report below does not exist with previous version of R. In order to reproduce the error you must install a package of your choice from source (tar.gz). -Create a .Rprofile file with the following command in it : setwd("D:/") -Close your R se