View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from

5.0 | 7 ratings Rate this file 14 Downloads (last 30 days) File Size: 1.69 KB File ID: #28370 Version: 1.0




Save workspace variables to an R data file.

| Watch this File

File Information

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 (, for instance.


Matlab R Link inspired this file.

MATLAB release MATLAB 7.9 (R2009b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (8)
21 Jan 2017 Bogdan Potanin

It works perfect, thank you very much!

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

23 Jun 2016 Enric Junque de Fortuny

Unfortunately, this doesn't work anymore:

In matlab:


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

Comment only
26 Aug 2014 JUN

JUN (view profile)

05 Nov 2013 Philipp Berens

21 Nov 2012 Lyuboslav Petrov


08 Aug 2012 Alex Zhou

05 Jul 2012 Raymundo Marcos-Martinez

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

10 Aug 2010 David

David (view profile)

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.

Contact us