correctly set dimnames for matrices#428
Conversation
|
You can test on similar platforms to github actions with |
yes! it's fixed now |
|
Nicely done! Not that I'm a cpp11 developer - but as a matter of style, I would make the tests 'simpler' and more clear about what they test. For example, there's no need to calculate logarithms. I would test two things specifically:
|
good point ! the log was just a "my brain defaults to log and OLS" |
|
it would be good to merge this PR and then adapt the tests here |
|
hi @DavisVaughan and @hadley |
13765c0 to
1cc6a00
Compare
1cc6a00 to
00bd129
Compare
There was a bug in the matrix class such that attributes cannot be set (ref: https://stackoverflow.com/a/76019987/3720258). This was mentioned in #273.
With cpp11 0.5.1 I can add row and column names from C++ as long as the object is a
sexpinstead of a*_matrix<>(example: https://github.com/pachadotdev/economiccomplexity/blob/main/src/code.cpp#L28-L29)With these changes, it is possible to assign colnames/rownames by borrowing from an input matrix or by setting
dimnames = list(...).Acknowledgements to @stephematician! It only took me 2 yrs to take intensive C++ courses at UofT to 1st learn proper C++, and then use that knowledge for my own research.
There is a problem with gh-actions. On my laptop, I can useI fixed that with a workaround.auto,attribute_proxy<V>or `SEXP for lines 192-194 in matrix.hpp and it works. With GHA, it return an error.