-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
228 lines (150 loc) · 6.59 KB
/
README.Rmd
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
---
output:
github_document
---
# rSharp
<!-- badges: start -->
[![R-CMD-check](https://github.com/Open-Systems-Pharmacology/rSharp/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/Open-Systems-Pharmacology/rSharp/actions/workflows/R-CMD-check.yaml)
[![Codecov test coverage](https://codecov.io/gh/Open-Systems-Pharmacology/rSharp/branch/develop/graph/badge.svg)](https://app.codecov.io/gh/Open-Systems-Pharmacology/rSharp?branch=develop)
<!-- badges: end -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
message = FALSE,
warning = FALSE,
out.width = "100%"
)
```
<!-- README.md is generated from README.Rmd. Please edit that file -->
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](https://github.com/rdotnet/rClr) package and
utilizes some of its code base.
## Important notes
As `{rSharp}` is provided with precompiled binary files, it is currently a
[binary](https://cran.r-project.org/doc/manuals/R-exts.html#Building-binary-packages-1) 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](#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](#build).
## Installation
### Windows
#### Prerequisites
- Latest Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019 available [here](https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads)
- .NET 8 runtime available [here](https://dotnet.microsoft.com/download/dotnet/8.0/runtime).
#### Install from Github
You can install the package from GitHub with pre-build binaries by running:
```r
install.packages("pak")
pak::pak("Open-Systems-Pharmacology/rSharp@*release")
```
Get the latest development version with:
```r
pak::pak("Open-Systems-Pharmacology/rSharp")
```
#### Install from Binary
Alternatively, download the attached binary file (`.zip`) from [latest release](https://github.com/Open-Systems-Pharmacology/rSharp/releases), and install it locally using:
```r
install.packages("path/to/rSharp_X.zip", type = "win.binary")
```
### MacOS
#### Prerequisites
- .NET 8 runtime available [here](https://dotnet.microsoft.com/download/dotnet/8.0/runtime) (click on the macOS tab).
#### Install from Github
You can install the package from GitHub with pre-build binaries by running:
```r
install.packages("pak")
pak::pak("Open-Systems-Pharmacology/rSharp@*release")
```
Get the latest development version with:
```r
pak::pak("Open-Systems-Pharmacology/rSharp")
```
#### Install from Binary
Alternatively, download the attached binary file (`.tgz`) from [latest release](https://github.com/Open-Systems-Pharmacology/rSharp/releases), and install it locally using:
```r
install.packages("path/to/rSharp_X.tgz")
```
### Ubuntu
#### Prerequisites
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
```
#### Install from Github
You can install the package from GitHub with pre-build binaries by running:
```r
install.packages("pak")
pak::pak("Open-Systems-Pharmacology/rSharp@*release")
```
Get the latest development version with:
```r
pak::pak("Open-Systems-Pharmacology/rSharp")
```
#### Install from Binary
Alternatively, download the attached binary file (`.tar.gz`) from [latest release](https://github.com/Open-Systems-Pharmacology/rSharp/releases), and install it locally using:
```r
install.packages("path/to/rSharp_X.tar.gz")
```
## 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
```
set R_INSTALL_PATH = "C:\Program Files\R\R-4.3.3"
```
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
```
devtools::install()
```
### Ubuntu
Set up .NET SDK and `nuget` (the latter to get the required dependencies)
Optionally set up to build the binaries
```
sudo apt-get install dotnet-sdk-8.0
sudo apt-get install nuget
```
Navigate to the ```rSharp\shared``` directory and run
```
make
```
Then change back to the ```rSharp``` directory start your preferred R environment and run the following R commands
```
devtools::install()
```
### MacOS
Download and install [.NET SDK 8](https://dotnet.microsoft.com/en-us/download/dotnet/8.0)
Install Homebrew and use it to install build tools
```
brew install nuget
brew install cmake
brew install gcc
```
Navigate to the ```rSharp\shared``` directory and run
```
make
```
Then change back to the ```rSharp``` directory start your preferred R environment and run the following R commands
```
devtools::install()
```
## 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](https://github.com/Open-Systems-Pharmacology/Suite/blob/master/CODE_OF_CONDUCT.md).
## Contribution
We encourage contribution to the Open Systems Pharmacology community. Before getting started please read the [contribution guidelines](https://dev.open-systems-pharmacology.org/r-development-resources/collaboration_guide).
If you are contributing code, please be familiar with the [coding standards](https://dev.open-systems-pharmacology.org/r-development-resources/coding_standards_r).
## License
The `{rSharp}` package is released under the [GPLv2 License](LICENSE).
All trademarks within this document belong to their legitimate owners.