makeSliceMap {matconv} | R Documentation |
Make the maps for converting slice notation
Description
Make the maps for converting slice notation
Usage
makeSliceMap(leftSym, rightSym, rClass, matClass = "")
Arguments
leftSym |
The left symbol that contains the Matlab data |
rightSym |
the right symbol that contains the Matlab data |
rClass |
The formal r class name that defines what the R data is outputted as |
matClass |
The name of the Matlab class that should be converted |
Details
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.
Value
A function that takes in a string and converts all the given slice notation
Examples
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']]
[Package matconv version 0.4.2 Index]