Make the maps for converting slice notation
makeSliceMap(leftSym, rightSym, rClass, matClass = "")
The left symbol that contains the Matlab data
the right symbol that contains the Matlab data
The formal r class name that defines what the R data is outputted as
The name of the Matlab class that should be converted
A function that takes in a string and converts all the given slice notation
Slice notation for matrices are tricky because they can easily be confused with the requirements for conversion are the bounds given by both left and right symbols or the Matlab class. The Matlab class allows for the conversion of structures but is really just a dictionary for the different bounds.
# NOT RUN {
sliceMap <- makeSliceMap("{", "}", "list")
sliceMap("junk <- importData{300}")
# "junk <- importData[[300]]"
sliceMap <- makeSliceMap(matClass = "structure", rClass = "list")
sliceMap("junk <- students.AP.GPA")
# junk <- students[['AP']][['GPA']]
# }
Run the code above in your browser using DataLab