Closed rajasekhar-thiru closed 7 years ago
Hi Raja,
You can convert any .mat
file to .rda
using two lines of code:
obj <- R.matlab::readMat("ex3data1.mat")
save(obj,file = "ex3data1.rda")
just make sure to install the following package:
install.packages("R.matlab")
thank you. It worked. The list2env command that you provided after load was giving an error:
list2env(data,.GlobalEnv) Error in list2env(data, .GlobalEnv) : first argument must be a named list
Problem resolved once i replaced 'data' with 'obj' obj <- R.matlab::readMat('ex3data1.mat') save(obj,file = "ex3data1.Rda") load('ex3data1.Rda') list2env(obj,.GlobalEnv) # changed from list2env(data,.GlobalEnv)
Thank you for the help.
Hello Farid, I am a newbie in R; finding your Github repository very useful in coming up to speed.
Can you please help me understand how you converted a matlab file (.mat) into an R file (.Rda)
https://github.com/faridcher/ machine-learning-course/tree/ master/Starter/mlclass-ex3
from ex3data1.mat in matlab to 'ex3data1.Rda'
Thank you for the help.