stewid / rmatio Goto Github PK
View Code? Open in Web Editor NEWAn R package to read and write matlab files
License: GNU General Public License v3.0
An R package to read and write matlab files
License: GNU General Public License v3.0
Can we do something with NULL objects in nested lists during writing? Currently we get error("Unable to write list");
IMHO, it would be better not to have such situation but some R packages produce indeed dataframes with NULL objects deeply in nested list structures. My quick and dirty solution is recursive replacement of NULL objects in R with something readable by rmatio but would it be possible to do it automatically with additional parameter to write.mat() function?
Wonderful package, @stewid!!! ๐
Would be great if r-rmatio could be made available on the conda-forge channel. Many of us use this for software development and create reproducible workflows. I know r-rmatio's currently on the r channel but I'm having a lot of trouble building an image with it because of conflicts. Let me know what you think! Thank you!!!
First of all, thank you for this great package. I was trying to read the attached file but I got this error:
Error in read.mat(file.path("D:", "_R_WD", "git_projects", "rat_wm_training", :
Read5: 3 is not a supported class
Is it a mat file version problem?
Many thanks
example.zip
Hi,
Thank you for building this package.
I experienced an import error in 3/40 .mat files, with an error message of
InflateVarName: inflate returned buffer error
not sure what is wrong, when all .mat files appear to have the same structure.
Regards,
Bernard
Hi,
Please find the files which are able to reproduce errors on following link:
http://www.mediafire.com/download/xllevn8yqn2jyoa/rmatio_error.rar
data.RData
contains the data I want to save to .mat file. DT
is my data.table which contains three different vdid
, I want to save the data for each vdid
. Therefore, I use test_script.r
to do what I want.
But something wired happens, some files with compression get error when importing by read.mat
and some not. If I save them without compression, they are all fine. I do not know what cause this difference.
I have tried:
class
and mode
)My session information:
`
R version 3.2.2 (2015-08-14)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
locale:
[1] LC_COLLATE=Chinese (Traditional)_Taiwan.950 LC_CTYPE=Chinese (Traditional)_Taiwan.950
[3] LC_MONETARY=Chinese (Traditional)_Taiwan.950 LC_NUMERIC=C
[5] LC_TIME=Chinese (Traditional)_Taiwan.950
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] rmatio_0.11.0 lattice_0.20-33 Matrix_1.2-2 magrittr_1.5 purrr_0.2.0
[6] tidyr_0.2.0 dplyr_0.4.3 plyr_1.8.3 data.table_1.9.4 RevoUtilsMath_3.2.2
loaded via a namespace (and not attached):
[1] Rcpp_0.12.0 assertthat_0.1 grid_3.2.2 chron_2.3-47 R6_2.1.1 DBI_0.3.1 stringi_0.5-5
[8] reshape2_1.4.1 tools_3.2.2 stringr_1.0.0 parallel_3.2.2
`
Update bundled matio to latest version 1.5.3
http://sourceforge.net/projects/matio/files/matio/1.5.3/
Hello,
I would like to report a speed difference between rmatio
and R.matlab
libraries. The rio
package uses rmatio
so it would be nice if the time to read a MATLAB matrice could be reduced:
> system.time(x <- R.matlab::readMat("http://ufldl.stanford.edu/housenumbers/test_32x32.mat"))
Registered S3 method overwritten by 'R.oo':
method from
throw.default R.methodsS3
user system elapsed
7.65 2.25 27.08
> system.time(x <- rmatio::read.mat("http://ufldl.stanford.edu/housenumbers/test_32x32.mat"))
user system elapsed
34.54 109.36 161.91
> system.time(x <- rio::import("http://ufldl.stanford.edu/housenumbers/test_32x32.mat"))
user system elapsed
97.75 131.48 308.01
After reading, not able to retain names for the following file :
However same format file as given below is properly read and all names retained.
When trying to open a .mat
(v7
) file (for example, https://gofile.io/?c=GJxhm0), the following error is returned.
Error in read.mat("~/Downloads/a.mat") : Unable to open file.
Matlab: R2017b
โ Session info โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
setting value
version R version 3.6.2 (2019-12-12)
os macOS Catalina 10.15.3
system x86_64, darwin15.6.0
ui RStudio
language (EN)
collate en_GB.UTF-8
ctype en_GB.UTF-8
tz Europe/Berlin
date 2020-03-03
โ Packages โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
package * version date lib source
assertthat 0.2.1 2019-03-21 [1] CRAN (R 3.6.0)
backports 1.1.5 2019-10-02 [1] CRAN (R 3.6.0)
blogdown 0.17 2019-11-13 [1] CRAN (R 3.6.0)
bookdown 0.17 2020-01-11 [1] CRAN (R 3.6.0)
callr 3.4.2 2020-02-12 [1] CRAN (R 3.6.0)
cli 2.0.2 2020-02-28 [1] CRAN (R 3.6.0)
crayon 1.3.4 2017-09-16 [1] CRAN (R 3.6.0)
desc 1.2.0 2018-05-01 [1] CRAN (R 3.6.0)
devtools 2.2.2 2020-02-17 [1] CRAN (R 3.6.0)
digest 0.6.25 2020-02-23 [1] CRAN (R 3.6.2)
ellipsis 0.3.0 2019-09-20 [1] CRAN (R 3.6.0)
evaluate 0.14 2019-05-28 [1] CRAN (R 3.6.0)
fansi 0.4.1 2020-01-08 [1] CRAN (R 3.6.0)
fortunes 1.5-4 2016-12-29 [1] CRAN (R 3.6.0)
fs 1.3.1 2019-05-06 [1] CRAN (R 3.6.0)
glue 1.3.1 2019-03-12 [1] CRAN (R 3.6.0)
htmltools 0.4.0 2019-10-04 [1] CRAN (R 3.6.0)
knitr 1.28 2020-02-06 [1] CRAN (R 3.6.2)
lattice 0.20-40 2020-02-19 [1] CRAN (R 3.6.0)
magrittr 1.5 2014-11-22 [1] CRAN (R 3.6.0)
Matrix 1.2-18 2019-11-27 [1] CRAN (R 3.6.2)
memoise 1.1.0 2017-04-21 [1] CRAN (R 3.6.0)
packrat 0.5.0 2018-11-14 [1] CRAN (R 3.6.0)
pkgbuild 1.0.6 2019-10-09 [1] CRAN (R 3.6.0)
pkgload 1.0.2 2018-10-29 [1] CRAN (R 3.6.0)
prettyunits 1.1.1 2020-01-24 [1] CRAN (R 3.6.0)
processx 3.4.2 2020-02-09 [1] CRAN (R 3.6.2)
ps 1.3.2 2020-02-13 [1] CRAN (R 3.6.0)
R6 2.4.1 2019-11-12 [1] CRAN (R 3.6.0)
Rcpp 1.0.3 2019-11-08 [1] CRAN (R 3.6.0)
remotes 2.1.1 2020-02-15 [1] CRAN (R 3.6.0)
rlang 0.4.5 2020-03-01 [1] CRAN (R 3.6.0)
rmarkdown 2.1 2020-01-20 [1] CRAN (R 3.6.0)
rmatio * 0.14.0 2019-03-18 [1] CRAN (R 3.6.0)
rprojroot 1.3-2 2018-01-03 [1] CRAN (R 3.6.0)
rstudioapi 0.11 2020-02-07 [1] CRAN (R 3.6.0)
sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 3.6.0)
testthat 2.3.2 2020-03-02 [1] CRAN (R 3.6.2)
usethis 1.5.1 2019-07-04 [1] CRAN (R 3.6.0)
withr 2.1.2 2018-03-15 [1] CRAN (R 3.6.0)
xfun 0.12 2020-01-13 [1] CRAN (R 3.6.0)
yaml 2.2.1 2020-02-01 [1] CRAN (R 3.6.0)
When I open the attached file, I loose most of the data and the nesting of participants in the data does not work (only the first participant's data is shown and everybody elses data is droped. It opens with R.matlab but it doesn't have the labels which rmatio preserves. It would be great if there was a way to extract the data.
Hello,
The following examples show that "a$bias$z" is not correctly saved in .mat:
a = list()
a$bias$x = matrix(1:4,2,2)
a$bias$y = rep(1,2)
a$bias$z = matrix(1,1,1)
write.mat(a, paste("a",".mat", sep = ""))
I would appreciate very much if this bug could be fixed.
Many thanks for this package!
I have a Matlab generated file that causes a problem: Error message is
read.mat("OneOnly.mat")
Error in read.mat("OneOnly.mat") :
InflateDimensions: Reading dimensions expected type MAT_T_INT32
I assume it has to do with class type 17 in the Timer field not recognized; R.matlab also fails, but Python and Matlab can read the file without problems. However, pure C-matio can read it (not tested myself)
Here is the download link:
http://menne-biomed.de/uni/matioProblem.zip
R version 3.1.0 (2014-04-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
locale:
[1] LC_COLLATE=German_Germany.1252 LC_CTYPE=German_Germany.1252
[3] LC_MONETARY=German_Germany.1252 LC_NUMERIC=C
[5] LC_TIME=German_Germany.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] R.matlab_2.2.3 rmatio_0.9.0 lattice_0.20-29 Matrix_1.1-3 testthat_0.8.1
There seems to be a semi working mat73 branch which has issues loading a mat 7.3 file I have. Is this project still alive?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.