'C++' Header Files and Compiled Library from 'Abseil'

Wraps the 'Abseil' 'C++' library for use by R packages. Provides both header files and a compiled static library ('libabsl.a') so that downstream packages can link non-header-only 'Abseil' components without recompiling the library themselves. Original files are from < https://github.com/abseil/abseil-cpp>. Patches are located at < https://github.com/doccstat/abseil-r/tree/main/local/patches>.


abseil: Abseil Headers for R

CRANstatus Downloads R-CMD-check LastCommit r-universe

Synopsis

This package provides R with access to Abseil header files.

This package is a direct import of Abseil 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

# Install from CRAN
install.packages("abseil")
Development version
# 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")

Example

Directly usage in 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()
#> [1] "foo-bar-baz"
Usage in Rcpp package
#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.

Authors

Abseil Team, Xingchi Li

Contact us

For bugs related to Abseil logistics, please report the issue to the official Abseil GitHub Repo.

  1. File a ticket at GitHub Issues.
  2. Contact the authors specified in DESCRIPTION.

Stargazers over time

Stargazers overtime

License

This package is provided under the same license as Abseil itself, the Apache-2.0 license.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("abseil")

2026.5.26.0 by Xingchi Li, 3 months ago


https://abseil.xingchi.li, https://github.com/doccstat/abseil-r


Report a bug at https://github.com/doccstat/abseil-r/issues


Browse source code at https://github.com/cran/abseil


Authors: Xingchi Li [ctb, cre, cph] (ORCID: , Abseil Team [aut, cph]


Documentation:   PDF Manual  


Apache License (>= 2) license


Suggests Rcpp

System requirements: C++17


See at CRAN