File tree Expand file tree Collapse file tree 7 files changed +68
-6
lines changed Expand file tree Collapse file tree 7 files changed +68
-6
lines changed Original file line number Diff line number Diff line change
1
+ ^.*\.Rproj$
2
+ ^\.Rproj\.user$
Original file line number Diff line number Diff line change 1
1
* .o
2
2
* .so
3
3
.Rhistory
4
+ * .Rcheck
5
+ .Rproj.user
6
+ * .tgz
7
+ * .tar.gz
Original file line number Diff line number Diff line change 1
1
Package: swigr
2
- Title: What the Package Does (One Line, Title Case)
2
+ Title: An example R package using SWIG to wrap C++
3
3
Version: 0.0.1
4
4
Authors@R:
5
5
person(given = "First",
6
6
family = "Last",
7
7
role = c("aut", "cre"),
8
8
email = "first.last@example.com",
9
9
comment = c(ORCID = "YOUR-ORCID-ID"))
10
- Description: What the package does (one paragraph).
11
- License: What license it uses
10
+ Description: A simple example repo to test making an R package
11
+ from C++ code using SWIG to generate wrapper code. The goal is
12
+ to make it easy to install for both Linux, MacOS and Windows
13
+ users. Windows users should be able to install a binary package
14
+ to not require tools to compile the C++ code.
15
+ License: AGPL (>= 3)
12
16
Encoding: UTF-8
13
17
LazyData: true
14
18
RoxygenNote: 7.1.0
Original file line number Diff line number Diff line change 1
- # swigr
2
- An example project to test building an R package from C++ code using SWIG
1
+ # SwigR - An example R package using SWIG to wrap C++
2
+
3
+ A simple example repo to test making an R package
4
+ from C++ code using SWIG to generate wrapper code. The goal is
5
+ to make it easy to install for both Linux, MacOS and Windows
6
+ users. Windows users should be able to install a binary package
7
+ to not require tools to compile the C++ code.
8
+
9
+ ## Install
10
+
11
+ Swigr can be installed as a source package from R by running
12
+
13
+ ``` R
14
+ devtools :: install_github(" danieledler/swigr" )
15
+ ```
16
+
17
+ Binary bundle can be installed from R by running
18
+
19
+ ``` R
20
+ devtools :: install_url(" https://github.com/danieledler/swigr/releases/download/v0.0.1/swigr_0.0.1.tgz" )
21
+ ```
22
+
3
23
4
24
## TODO
5
25
6
- Add ` zzz.R ` with ` .onUnload() ` to clean SWIG?
26
+ * Add ` zzz.R ` with ` .onUnload() ` to clean SWIG?
Original file line number Diff line number Diff line change @@ -20,6 +20,9 @@ setwd("~/dev/R/swig")
20
20
devtools :: install(" swigr" )
21
21
setwd(" ~/dev/R/swig/swigr" )
22
22
23
+ # Install local binary bundle
24
+ devtools :: install_url(" file:///Users/Daniel/dev/R/swig/swigr_bin_man.tgz" )
25
+
23
26
# Test package
24
27
swigr :: test_r()
25
28
swigr :: test_example()
Original file line number Diff line number Diff line change 5
5
# source("example.R")
6
6
# cacheMetaData(1)
7
7
8
+ search()
9
+ # detach(package:swig, unload = TRUE)
10
+
8
11
install.packages(" devtools" )
12
+
13
+ # Install from github
9
14
devtools :: install_github(" danieledler/swigr" )
10
15
16
+ # Install source bundle from URL
17
+ devtools :: install_url(" https://github.com/danieledler/swigr/releases/download/v0.0.1/swigr_0.0.1.tar.gz" )
18
+
19
+ # Install binary bundle from URL
20
+ devtools :: install_url(" https://github.com/danieledler/swigr/releases/download/v0.0.1/swigr_0.0.1.tgz" )
21
+
22
+
11
23
swigr :: test_example()
12
24
13
25
# ----- Object creation -----
Original file line number Diff line number Diff line change
1
+ Version: 1.0
2
+
3
+ RestoreWorkspace: Default
4
+ SaveWorkspace: Default
5
+ AlwaysSaveHistory: Default
6
+
7
+ EnableCodeIndexing: Yes
8
+ UseSpacesForTab: Yes
9
+ NumSpacesForTab: 2
10
+ Encoding: UTF-8
11
+
12
+ RnwWeave: Sweave
13
+ LaTeX: pdfLaTeX
14
+
15
+ BuildType: Package
16
+ PackageUseDevtools: Yes
17
+ PackageInstallArgs: --no-multiarch --with-keep.source
You can’t perform that action at this time.
0 commit comments