File Exchange

image thumbnail

saveR

version 1.0.0.0 (1.69 KB) by Jeroen Janssens
Save workspace variables to an R data file.

8 Downloads

Updated 03 Aug 2010

View License

saveR('FILENAME') saves all workspace variables to the "R-file" named FILENAME.

SAVER('FILENAME', 'X', 'Y', 'Z') saves X, Y, and Z.

saveR can handle scalars, vectors, matrices, and cell arrays of strings. NaN's are saved as NA. Since R cannot handle structures, they will not be saved and a warning will be given.

Useful if you do not wish to load variables directly in R using a COM based interface (using MATLAB R-link #5051) or if you wish to use JAGS (http://sourceforge.net/projects/mcmc-jags), for instance.

Cite As

Jeroen Janssens (2020). saveR (https://www.mathworks.com/matlabcentral/fileexchange/28370-saver), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (8)

It works perfect, thank you very much!

Also I have solved Enric Junque de Fortuny problem using source(filneDirectory) instead of load(filneDirectory).

Unfortunately, this doesn't work anymore:

In matlab:

saveR('data.Rdata','outAUC','outSTD');

In R:

Error: bad restore file magic number (file may be corrupted) -- no data loaded
In addition: Warning message:
file ‘data.Rdata’ has magic number '"outA'
Use of save versions prior to 2 is deprecated

JUN

Wonderful!

Alex Zhou

Excellent tool! Now I have available the best "statistics toolbox".

David

Great file! A simple and fast way to move everything to R--saved me tons of time trying to import from R.

NOTICE: after the workspace is saved in the R path it must be loaded using the source('filename') function.
load('filename') can only be used on variables saved with the save('filename') function and will throw and error in this case.

MATLAB Release Compatibility
Created with R2009b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Acknowledgements

Inspired by: MATLAB R-link