The rSharp R package provides access to .NET
libraries from R. It allows to create .NET
objects, access their fields, and call their methods.
This package is based on the rClr package and utilizes some of its code base.
Important notes
As rSharp is provided with precompiled binary files, it is currently a binary package.
The package utilizes two code bases - the R code which is exposed to the user, and the C++/C# code that communicates with the .NET libraries. The end user of the package will only interact with the R code, and pre-build C++/C# libraries are supplied with the package. See section Installation for instructions on how to install the package.
Advanced users and C++/C# developers might want to build the C++/C# code from source. For this, follow the instructions in section Build.
Installation
Windows
Install from Github
You can install the package from GitHub with pre-build binaries by running:
install.packages("pak")
pak::pak("Open-Systems-Pharmacology/rSharp@*release")
Get the latest development version with:
pak::pak("Open-Systems-Pharmacology/rSharp")
Install from Binary
Alternatively, download the attached binary file from latest release, and install it locally using:
install.packages("path/to/rSharp_X.zip", type = "win.binary")
Ubuntu
Run the following commands to install the required dependencies:
sudo apt-get install dotnet-runtime-8.0 libcurl4-openssl-dev libssl-dev libxml2-dev
sudo apt-get install libfontconfig1-dev libharfbuzz-dev libfribidi-dev
sudo apt-get install libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev
Symlink libdl.so.2 to libdl.so
Install the package from GitHub with pre-build binaries by running:
install.packages("remotes")
pak::pak("Open-Systems-Pharmacology/rSharp@*release")
Get the latest development version with:
pak::pak("Open-Systems-Pharmacology/rSharp")
Build
Windows
To build the C++/C# libraries from source, make sure the Desktop development with C++
workload is installed in Visual Studio.
Create an environment variable R_INSTALL_PATH
and set the value to the path where R is installed
Start Visual Studio and open the rSharp.sln
solution file and build the solution. The build process will automatically copy the required files to the rSharp/inst/lib
folder.
Then start your preferred R environment and run the following R commands from within the rSharp
folder
User guide
Examples of interacting with .NET assemblies using this package are detailed in vignette('user-guide')
. Some useful tips around using the package are available in the vignette('knowledge-base')
.
Code of conduct
Everyone interacting in the Open Systems Pharmacology community (codebases, issue trackers, chat rooms, mailing lists etc…) is expected to follow the Open Systems Pharmacology code of conduct.
Contribution
We encourage contribution to the Open Systems Pharmacology community. Before getting started please read the contribution guidelines. If you are contributing code, please be familiar with the coding standards.
License
The rSharp package is released under the GPLv2 License.
All trademarks within this document belong to their legitimate owners.