mat2r {matconv} | R Documentation |
mat2r
Description
The top level driver function to call the converting functions and handle the input and output.
Usage
mat2r(
inMat,
pathOutR = "",
funcConverters = NULL,
dataConverters = NULL,
verbose = 1
)
Arguments
inMat |
A file path with the input Matlab / Octave code to be converted or a character vector of the code that needs to be converted |
pathOutR |
A file path with the desired output file location |
funcConverters |
A list of function converters that the user wants to
use in this conversion made by |
dataConverters |
A list of data converters that the user wants to
use in this conversion made by |
verbose |
A number indicating the amount of messages that should be outputed.
|
Value
A list containing the original code (named matCode) and the converted code (named rCode).
Examples
matIn <- c("function [ dat ] = xlsReadPretty(varargin)",
" didThing = 1*3;",
" dat = didThing / 3;",
"end")
mat2r(matIn, verbose = 0)$rCode
# "xlsReadPretty <- function(...){"
# "\tvarargin <- list(...)"
# " didThing <- 1*3"
# " dat <- didThing / 3"
#"\treturn(dat)"
#"}"