Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jimhester/bloom

R Bloom filter implementation using Rcpp bindings for dabloom.
https://github.com/jimhester/bloom

Last synced: about 2 months ago
JSON representation

R Bloom filter implementation using Rcpp bindings for dabloom.

Awesome Lists containing this project

README

        

---
output:
md_document:
variant: markdown_github
---

```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```
# bloom #

Scaling, counting Bloom filter for R using Rcpp bindings for
[dablooms](https://github.com/bitly/dablooms/).

Note the dablooms implementation requires an additional metadata id for
insertions and deletions. This id is a monotonically increasing integer which
is used to determine which scaling filter the item should be added or removed
from.

### Example usage

```{r}
library(bloom)
bloom <- bloom(capacity = 1000, error_rate = .05, filename = "/tmp/bloom.bin")
bloom$add("foo", 2)
bloom$contains("bar")
bloom$contains("foo")
bloom$remove("foo", 2)
bloom$contains("foo")
bloom$add("foo", 2)
rm(bloom)
bloom <- bloom(capacity = 1000, error_rate = .05, filename = "/tmp/bloom.bin", exists = TRUE)
bloom$contains("foo")
```