-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathOctaveFunction-class.Rd
59 lines (50 loc) · 1.41 KB
/
OctaveFunction-class.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/OctaveFunction-class.R
\docType{class}
\name{OctaveFunction-class}
\alias{OctaveFunction-class}
\alias{OctaveFunction}
\alias{show,OctaveFunction-method}
\title{Wrapping and Defining Octave Functions from R}
\usage{
OctaveFunction(fun, check = TRUE)
}
\arguments{
\item{fun}{the name of an existing Octave function or, Octave code that
defines a function.}
\item{check}{logical that indicates if the existence of the Octave function
should be checked.
If function does not exist then, an error or a warning is thrown if \code{check=TRUE}
or \code{check=FALSE} respectively.
The existence check can be completly disabled with \code{check=NA}.}
}
\description{
Wrapping and Defining Octave Functions from R
\code{OctaveFunction} objects can be created from existing Octave function
using their name, or directly from their Octave implementation.
In this case, the Octave code is parsed to extract and use the name of the first
function defined therein.
}
\section{Slots}{
\describe{
\item{\code{name}}{name of the wrapped Octave function}
}}
\examples{
\dontshow{
options(R_CHECK_RUNNING_EXAMPLES_=TRUE) ## roxygen generated flag
}
osvd <- OctaveFunction('svd')
osvd
osvd(matrix(1:9,3))
orand <- OctaveFunction('rand')
orand()
orand(2)
orand(2, 3)
# From source code
myfun <- OctaveFunction('function [Y] = somefun(x)
Y = x * x;
end
')
myfun
myfun(10)
}