makeDataMap {matconv} | R Documentation |
Make the maps for the data
Description
Make the maps for the data
Usage
makeDataMap(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
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 Matlab lines and changes the data into R data lines
Examples
dataMap <- makeDataMap("[", "]", "matrix")
dataMap("thing <- [23,2, 3.2; 7, 6, 8]")
# "thing <- matrix(c(23, 2, 3.2, 7, 6, 8), nrow = 2, ncol = 3)"
dataMap <- makeDataMap(rClass = "list", matClass = "cell")
dataMap("otherThing <- {23,2, '3.2'; NaN, 6, 8}")
# "otherThing <- list(list(23, 2, '3.2'), list(NaN, 6, 8))"
[Package matconv version 0.4.2 Index]