R html docs formatting fixes.
[skip-ci]
This commit is contained in:
parent
dfcc11042f
commit
f4208a0a41
1 changed files with 23 additions and 7 deletions
|
|
@ -28,7 +28,9 @@
|
||||||
R is a GPL'ed open source statistical and plotting environment.
|
R is a GPL'ed open source statistical and plotting environment.
|
||||||
Information about R can be found at <a
|
Information about R can be found at <a
|
||||||
href="http://www.r-project.org/">www.r-project.org</a>.
|
href="http://www.r-project.org/">www.r-project.org</a>.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
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. The R bindings also work on Microsoft Windows using Visual C++.
|
with gcc. The R bindings also work on Microsoft Windows using Visual C++.
|
||||||
|
|
@ -113,11 +115,10 @@ cacheMetaData(1)
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<p>
|
||||||
The cacheMetaData(1) will cause R to refresh its object tables.
|
The cacheMetaData(1) will cause R to refresh its object tables.
|
||||||
Without it, inheritance of wrapped objects may fail.
|
Without it, inheritance of wrapped objects may fail.
|
||||||
|
These two files can be loaded in any order.
|
||||||
<p>
|
|
||||||
These two files can be loaded in any order
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
@ -140,18 +141,22 @@ Error in .Call("R_swig_fact", s_arg1, as.logical(.copy), PACKAGE = "example") :
|
||||||
<H2><a name="R_nn4">33.3 Precompiling large R files</a></H2>
|
<H2><a name="R_nn4">33.3 Precompiling large R files</a></H2>
|
||||||
|
|
||||||
|
|
||||||
|
<p>
|
||||||
In cases where the R file is large, one make save a lot of loading
|
In cases where the R file is large, one make save a lot of loading
|
||||||
time by precompiling the R wrapper. This can be done by creating the
|
time by precompiling the R wrapper. This can be done by creating the
|
||||||
file makeRData.R which contains the following
|
file makeRData.R which contains the following
|
||||||
|
</p>
|
||||||
|
|
||||||
<pre>
|
<div class="code"><pre>
|
||||||
source('BigFile.R')
|
source('BigFile.R')
|
||||||
save(list=ls(all=TRUE), file="BigFile.RData", compress=TRUE)
|
save(list=ls(all=TRUE), file="BigFile.RData", compress=TRUE)
|
||||||
q(save="no")
|
q(save="no")
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
|
<p>
|
||||||
This will generate a compiled R file called BigFile.RData that
|
This will generate a compiled R file called BigFile.RData that
|
||||||
will save a large amount of loading time.
|
will save a large amount of loading time.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -192,21 +197,27 @@ of the proxy class baggage you see in other languages.
|
||||||
R doesn't have a native enumeration type. Enumerations are represented
|
R doesn't have a native enumeration type. Enumerations are represented
|
||||||
as character strings in R, with calls to R functions that convert back
|
as character strings in R, with calls to R functions that convert back
|
||||||
and forth between integers.
|
and forth between integers.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
The details of enumeration names and contents are stored in hidden R
|
The details of enumeration names and contents are stored in hidden R
|
||||||
environments, which are named according the the enumeration name - for
|
environments, which are named according the the enumeration name - for
|
||||||
example, an enumeration colour:
|
example, an enumeration colour:
|
||||||
|
</p>
|
||||||
|
|
||||||
<div class="code"><pre>
|
<div class="code"><pre>
|
||||||
enum colour { red=-1, blue, green = 10 };
|
enum colour { red=-1, blue, green = 10 };
|
||||||
</pre></div>
|
</pre></div>
|
||||||
|
|
||||||
|
<p>
|
||||||
will be initialized by the following call in R:
|
will be initialized by the following call in R:
|
||||||
|
</p>
|
||||||
|
|
||||||
<div class="code"><pre>
|
<div class="code"><pre>
|
||||||
defineEnumeration("_colour",
|
defineEnumeration("_colour",
|
||||||
.values=c("red" = .Call('R_swig_colour_red_get',FALSE, PACKAGE='enum_thorough'),
|
.values=c("red" = .Call('R_swig_colour_red_get',FALSE, PACKAGE='enum_thorough'),
|
||||||
"blue" = .Call('R_swig_colour_blue_get',FALSE, PACKAGE='enum_thorough'),
|
"blue" = .Call('R_swig_colour_blue_get',FALSE, PACKAGE='enum_thorough'),
|
||||||
"green" = .Call('R_swig_colour_green_get',FALSE, PACKAGE='enum_thorough')))
|
"green" = .Call('R_swig_colour_green_get',FALSE, PACKAGE='enum_thorough')))
|
||||||
|
|
||||||
</pre></div>
|
</pre></div>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
@ -216,7 +227,9 @@ values for enumerations to be used. Calls to the C/C++ code require
|
||||||
the compiled library to be loaded, so a <tt>delayedAssign</tt> is employed
|
the compiled library to be loaded, so a <tt>delayedAssign</tt> is employed
|
||||||
within <tt>defineEnumeration</tt> in order to allow the code to be easily used in R
|
within <tt>defineEnumeration</tt> in order to allow the code to be easily used in R
|
||||||
packages.
|
packages.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
The user typically does not need to access the enumeration lookup
|
The user typically does not need to access the enumeration lookup
|
||||||
functions or know the name of the enumeration type used by
|
functions or know the name of the enumeration type used by
|
||||||
R. Attributes containing the type information are attached by swig to
|
R. Attributes containing the type information are attached by swig to
|
||||||
|
|
@ -224,14 +237,17 @@ functions requiring enumeration arguments or returning enumeration
|
||||||
values, and those attributes are used to identify and access the
|
values, and those attributes are used to identify and access the
|
||||||
appropriate environments and thus translate between characters
|
appropriate environments and thus translate between characters
|
||||||
and integers.
|
and integers.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
The relevant functions, for debugging purposes, are <tt>enumToInteger</tt> and
|
The relevant functions, for debugging purposes, are <tt>enumToInteger</tt> and
|
||||||
<tt>enumFromInteger</tt>.
|
<tt>enumFromInteger</tt>.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
Anonymous enumerations are ignored by the binding generation process,
|
Anonymous enumerations are ignored by the binding generation process,
|
||||||
leaving no way of accessing the value of anonymous enumerations from R
|
leaving no way of accessing the value of anonymous enumerations from R
|
||||||
code.
|
code.
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue