Re: [R] Matlab import

2007-04-19 Thread Henrik Bengtsson
Hi, as already mentioned, do not save MAT files in ASCII format but save to binary formats, i.e. do *not* use -ascii. Moreover, from ?readMat, you find that: From Matlab v7, _compressed_ MAT version 5 files are used by default [3]. These are not supported. Use 'save -V6' in Matlab to

Re: [R] Matlab import

2007-04-19 Thread Spencer Graves
Have you tried 'getVariable' from Matlab? I also recently failed to get 'readMat' to work for me -- probably because I hadn't saved the files using the options Henrik suggested below. Fortunately, I was able to get something like the following to work: # Start Matlab server

Re: [R] Matlab import

2007-04-19 Thread Henrik Bengtsson
On 4/19/07, Spencer Graves [EMAIL PROTECTED] wrote: Have you tried 'getVariable' from Matlab? I also recently failed to get 'readMat' to work for me -- probably because I hadn't saved the files using the options Henrik suggested below. Fortunately, I was able to get something

[R] Matlab import

2007-04-10 Thread Schmitt, Corinna
Dear R-Experts, here again a question concerning matlab. With the command matrixM=[1 2 3;4 5 6] a matrix under Matlab was constructed. It was than stored with the command save('matrixM.txt','matrixM'). Now I tried to import the data in R with the help of the command

Re: [R] Matlab import

2007-04-10 Thread tshort
I've used Henrik Bengtsson's R.matlab package several times to successfully read in matlab data files. It's normally as easy as: library(R.matlab) mats - readMat(matrixM.txt) - Tom Tom Short EPRI Schmitt, Corinna wrote: Dear R-Experts, here again a question concerning matlab. With the

Re: [R] Matlab import

2007-04-10 Thread Schmitt, Corinna
Hallo, I've used Henrik Bengtsson's R.matlab package several times to successfully read in matlab data files. It's normally as easy as: library(R.matlab) mats - readMat(matrixM.txt) - Tom I have imported this package, too. And tried your commands with the new txt-file as mentioned in my last

Re: [R] Matlab import

2007-04-10 Thread tshort
With readMat, don't use the -ascii option (which you didn't have in your first posting). I've never tried reading matlab's ascii format. In any case, readMat reads matlab's binary format. - Tom Tom Short EPRI Schmitt, Corinna wrote: Hallo, I've used Henrik Bengtsson's R.matlab package

Re: [R] Matlab import

2007-04-10 Thread Schmitt, Corinna
Hallo, With readMat, don't use the -ascii option (which you didn't have in your first posting). I've never tried reading matlab's ascii format. In any case, readMat reads matlab's binary format. - Tom I did the saving again without 'ascii' option but the import also did not work. I get the

Re: [R] Matlab import

2007-04-10 Thread Spencer Graves
Have you considered exporting from Matlab using the '-ascii' option, then reading it with 'read.table', after perhaps checking the first few rows using, e.g., 'readLines', and confirming that all records have the same length using 'count.fields'? Hope this helps. Spencer