Description Usage Arguments Details Examples
The function either connects to an existing running CLR bridge process at the given host:port or instantiates a new CLR server on the local computer with the given port and server arguments.
1 |
host |
The host machine on which the CLR bridge server is running; generally this is the localhost, which is the default. |
port |
The port on which the CLR bridge is listening (default: 56789) |
dll |
The path to an optional library dll to be loaded by the server. This dll would contain .NET classes and functions one wants to call from R. |
server.args |
Optional parameters to the CLRServer process (CLRServer.exe -help to list the options). |
If the .NET libraries are to be changed, the CLRServer process and R should be restarted. CLR references in the R session are only valid for the current CLR server instance.
Instead of calling .cinit(dll="~/mydll.dll") explictly one can set an environment variable Sys.setenv(rDotNet_DLL="~/mydll.dll") and use .cnew() and other functions after loading the package as opposed to first calling .cinit. One can also run the CLRServer from the command line or an IDE with the appropriate DLL.
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## Not run:
## create .NET bridge server, loading personal library to be referenced in the R session
.cinit (dll="~/Dev/MyLibrary.dll")
obj <- .cnew("NormalDistribution1D", 0.0, 1.0)
## alternative without explicit initialization
Sys.setenv(rDotNet_DLL="~/Dev/models.dll")
...
obj <- .cnew("NormalDistribution1D", 0.0, 1.0)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.