2020-11-19 07:49:30 +01:00
|
|
|
% Generated by roxygen2: do not edit by hand
|
|
|
|
|
% Please edit documentation in R/matlab2r.R
|
|
|
|
|
\name{matlab2r}
|
|
|
|
|
\alias{matlab2r}
|
|
|
|
|
\title{Convert Matlab function to R}
|
|
|
|
|
\usage{
|
2020-11-19 12:15:16 +01:00
|
|
|
matlab2r(
|
|
|
|
|
filename,
|
2020-11-19 13:33:21 +01:00
|
|
|
output = "diff",
|
2020-11-19 12:15:16 +01:00
|
|
|
improve_formatting = TRUE,
|
|
|
|
|
change_assignment = TRUE,
|
|
|
|
|
append = FALSE
|
|
|
|
|
)
|
2020-11-19 07:49:30 +01:00
|
|
|
}
|
|
|
|
|
\arguments{
|
|
|
|
|
\item{filename}{name of the file}
|
|
|
|
|
|
2020-11-19 13:33:21 +01:00
|
|
|
\item{output}{can be "asis", "clean", "save" or "diff"}
|
2020-11-19 10:48:33 +01:00
|
|
|
|
|
|
|
|
\item{improve_formatting}{if `TRUE` (default), makes minor changes
|
|
|
|
|
to conform to best-practice formatting conventions}
|
2020-11-19 12:15:16 +01:00
|
|
|
|
|
|
|
|
\item{change_assignment}{if `TRUE` (default), uses `<-` as the assignment operator}
|
|
|
|
|
|
|
|
|
|
\item{append}{if `FALSE` (default), overwrites file; otherwise, append
|
|
|
|
|
output to input}
|
2020-11-19 07:49:30 +01:00
|
|
|
}
|
|
|
|
|
\value{
|
|
|
|
|
text converted to R, printed to screen or replacing input file
|
|
|
|
|
}
|
|
|
|
|
\description{
|
|
|
|
|
Performs basic syntax conversion from Matlab to R
|
|
|
|
|
}
|
2020-11-19 12:15:16 +01:00
|
|
|
\note{
|
|
|
|
|
This function is intended to expedite the process of converting a
|
|
|
|
|
Matlab function to R by making common replacements. It does not have the
|
|
|
|
|
immediate goal of outputting a ready-to-use function. In other words,
|
|
|
|
|
after using this function you should go back to it and make minor changes.
|
|
|
|
|
|
|
|
|
|
It is also advised to do a dry-run with `output = "clean"` and only switching
|
|
|
|
|
to `output = "save"` when you are confident that no important code will be
|
|
|
|
|
lost (for shorter functions, a careful visual inspection should suffice).
|
|
|
|
|
}
|
2020-11-19 07:49:30 +01:00
|
|
|
\author{
|
|
|
|
|
Waldir Leoncio
|
|
|
|
|
}
|