R documentation minor tweaks
This commit is contained in:
parent
eb7160161d
commit
63b3fe8d3b
1 changed files with 14 additions and 8 deletions
|
|
@ -37,7 +37,7 @@ href="http://www.r-project.org/">www.r-project.org</a>.
|
||||||
The R bindings are under active development. They have been used to
|
The R bindings are under active development. They have been used to
|
||||||
compile and run an R interface to QuantLib running on Mandriva Linux
|
compile and run an R interface to QuantLib running on Mandriva Linux
|
||||||
with gcc. They are also used to create the SimpleITK R package, which
|
with gcc. They are also used to create the SimpleITK R package, which
|
||||||
runs on various linuxes and mac. Swig is used to create all wrapper
|
runs on Linux and MacOS. SWIG is used to create all wrapper
|
||||||
interfaces
|
interfaces
|
||||||
to <a href="http://http://www.simpleitk.org/">SimpleITK</a>. The R
|
to <a href="http://http://www.simpleitk.org/">SimpleITK</a>. The R
|
||||||
bindings also work on Microsoft Windows using Visual C++.
|
bindings also work on Microsoft Windows using Visual C++.
|
||||||
|
|
@ -211,26 +211,30 @@ the future we hope to utilise the built in R6 class structures.
|
||||||
The R interface has the following capabilities:
|
The R interface has the following capabilities:
|
||||||
<ul>
|
<ul>
|
||||||
<li> Destructor methods are registered and called automatically by the R garbage collector.
|
<li> Destructor methods are registered and called automatically by the R garbage collector.
|
||||||
<li> A range of std::vector types are converted automatically to R equivalents.
|
<li> A range of std::vector types are converted automatically to R equivalents via the std_vector.i library.
|
||||||
<li> The $ operator is used for method access.
|
<li> The $ operator is used for method access.
|
||||||
<li> Variable accessors are automatically generated and called via the $, [, [[, $<-, [<-, [[<- operators
|
<li> Variable accessors are automatically generated and called via the $, [, [[, $<-, [<-, [[<- operators.
|
||||||
</ul>
|
</ul>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<H3><a name="R_class_examples">34.6.1 Examples</a></H3>
|
<H3><a name="R_class_examples">34.6.1 Examples</a></H3>
|
||||||
|
|
||||||
|
|
||||||
|
<p>
|
||||||
Consider the following simple example:
|
Consider the following simple example:
|
||||||
|
</p>
|
||||||
|
|
||||||
<div class="code">
|
<div class="code">
|
||||||
<pre>
|
<pre>
|
||||||
class Vehicle {
|
class Vehicle {
|
||||||
private:
|
private:
|
||||||
int m_axles;
|
int m_axles;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
int Axles() {
|
int Axles() {
|
||||||
return(m_axles);
|
return(m_axles);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Available;
|
bool Available;
|
||||||
|
|
||||||
Vehicle() {
|
Vehicle() {
|
||||||
|
|
@ -246,12 +250,14 @@ public:
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<p>
|
||||||
The following options are available in R:
|
The following options are available in R:
|
||||||
|
</p>
|
||||||
|
|
||||||
<div class="code">
|
<div class="code">
|
||||||
<pre>
|
<pre>
|
||||||
v1 <- Vehicle()
|
v1 <- Vehicle()
|
||||||
v2 <- Vehicle(4)
|
v2 <- Vehicle(4)
|
||||||
# access members
|
# access members
|
||||||
v1$Axles()
|
v1$Axles()
|
||||||
[1] 2
|
[1] 2
|
||||||
|
|
@ -260,7 +266,7 @@ v2$Axles
|
||||||
v1$Available
|
v1$Available
|
||||||
[1] FALSE
|
[1] FALSE
|
||||||
# Set availabilty
|
# Set availabilty
|
||||||
v1$Available <- TRUE
|
v1$Available <- TRUE
|
||||||
v1$Available
|
v1$Available
|
||||||
[1] TRUE
|
[1] TRUE
|
||||||
</pre>
|
</pre>
|
||||||
|
|
@ -302,7 +308,7 @@ defined "_p_Vehicle"
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
The names in the accessorFuns list correspond to class methods while names in the vaccessors section
|
The names in the <tt>accessorFuns</tt> list correspond to class methods while names in the <tt>vaccessors</tt> section
|
||||||
correspond to variables that may be modified.
|
correspond to variables that may be modified.
|
||||||
</p>
|
</p>
|
||||||
<H2><a name="R_nn7">34.7 Enumerations</a></H2>
|
<H2><a name="R_nn7">34.7 Enumerations</a></H2>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue