-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
123 lines (87 loc) · 3.2 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
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-"
)
options(cli.hyperlink = FALSE, eval = TRUE)
```
# abseil: Abseil Headers for R <a href="https://abseil.xingchi.li"><img src="man/figures/logo.svg" align="right" height="138" /></a>
[![CRAN status](https://www.r-pkg.org/badges/version-last-release/abseil)](https://cran.r-project.org/package=abseil)
[![Downloads](https://cranlogs.r-pkg.org/badges/grand-total/abseil)](https://cran.r-project.org/package=abseil)
[![R-CMD-check](https://github.com/doccstat/abseil-r/workflows/R-CMD-check/badge.svg)](https://github.com/doccstat/abseil-r/actions)
[![Last Commit](https://img.shields.io/github/last-commit/doccstat/abseil-r)](https://github.com/doccstat/abseil-r)
[![r-universe](https://doccstat.r-universe.dev/badges/abseil)](https://doccstat.r-universe.dev)
## Synopsis
This package provides [R](https://www.r-project.org) with access to
[Abseil](https://abseil.io) header files.
This package is a direct import of [Abseil](https://abseil.io) libraries.
It can be used via the `LinkingTo:` field in the `DESCRIPTION` field of an R
package --- and the R package infrastructure tools will then know how to set
include flags correctly on all architectures supported by R.
## Installation
```{r eval = FALSE}
# Install from CRAN
install.packages("abseil")
```
<details close>
<summary>Development version</summary>
```{r eval = FALSE}
# Development version from r-universe with CRAN version as a fallback
install.packages(
"abseil",
repos = c("https://doccstat.r-universe.dev", "https://cloud.r-project.org")
)
## install.packages("pak")
pak::pak("doccstat/abseil-r")
## install.packages("devtools")
devtools::install_github("doccstat/abseil-r")
```
</details>
## Example
<details open>
<summary>Directly usage in R</summary>
```{r}
Rcpp::cppFunction(r"{
#include "absl/strings/str_join.h"
std::string joinString() {
std::vector<std::string> v = {"foo","bar","baz"};
return absl::StrJoin(v, "-");
}
}", depends = "abseil")
joinString()
```
</details>
<details close>
<summary>Usage in Rcpp package</summary>
``` cpp
#include <Rcpp.h>
#include "absl/strings/str_join.h"
//' @export
// [[Rcpp::export]]
std::string joinString() {
std::vector<std::string> v = {"foo","bar","baz"};
return absl::StrJoin(v, "-");
}
```
Bare minimum R package using the `abseil` package can be found at
[doccstat/abseil-r-example](https://github.com/doccstat/abseil-r-example).
</details>
## Authors
Abseil Team, Xingchi Li
## Contact us
For bugs related to Abseil logistics, please report the issue to the official
[Abseil GitHub Repo](https://github.com/abseil/abseil-cpp).
1. File a ticket at
[GitHub Issues](https://github.com/doccstat/abseil-r/issues).
2. Contact the authors specified in
[DESCRIPTION](https://github.com/doccstat/abseil-r/blob/main/DESCRIPTION#L5-L9).
## Stargazers over time
[![Stargazers over time](https://starchart.cc/doccstat/abseil-r.svg)](https://starchart.cc/doccstat/abseil-r)
## License
This package is provided under the same license as Abseil itself, the
Apache-2.0 license.