R.matlab
R.matlab copied to clipboard
fieldnames in nested structures lost
Hi Henrik,
Thanks for the useful package! i'm having an issue where nested structure fields aren't being imported with their names. Mat file is here: https://www.dropbox.com/s/ls8jzre5dyvf6xu/rmatlab_example.mat?dl=0. Any help greatly appreciated!
Thanks, Allie
> library(R.matlab)
> matstruct = readMat("rmatlab_example.mat")
> names(matstruct$qsm)
NULL

Any news on this front?
Sorry, not on my end. I don't actively develop R.matlab but PRs (code coupled with solid test scripts) are welcome.
use 'rmatio' instead
An update. I realised that field names are not dropped. MATLAB structs are read into R as 3-dimensional arrays and the content of the struct is in the first element of the 3rd dimension. Field names are retained as dimension names of the first dimension.
I’ll add a reproducible example later.
rmatio does not currently work for me (see issue here).
@stefanocoretta can you please give a reproducible example please ? OR maybe a PR
Hi @boral, unfortunately not because I am not using MATLAB any more.