eddelbuettel/rcppredis — pull request #5 by johnlaing (2014-11-04 18:48:03+00:00)
Title: add convenience functions for set operations

Example:
```R
r <- new(Redis)

## add an element, pull it back:
x <- data.frame(x=letters[1:5], y=rnorm(5))
r$sadd("myset", x)
# [1] 1

r$smembers("myset")
# [[1]]
# x y
# 1 a -1.57393802
# 2 b 0.29989637
# 3 c -0.09385390
# 4 d -0.01587167
# 5 e -0.03402492

## can't add it again
r$sadd("myset", x)
# [1] 0

## add another element, pull both back
y <- list(foo=list(bar="qux"))
r$sadd("myset", y)
# [1] 1

r$smembers("myset")
# [[1]]
# x y
# 1 a -1.57393802
# 2 b 0.29989637
# 3 c -0.09385390
# 4 d -0.01587167
# 5 e -0.03402492
#
# [[2]]
# [[2]]$foo
# [[2]]$foo$bar
# [1] "qux"

## drop the first element, pull back the other
r$srem("myset", x)
# [1] 1

r$smembers("myset")
# [[1]]
# [[1]]$foo
# [[1]]$foo$bar
# [1] "qux"
```