[Rcpp-devel] rcppredis
Whit Armstrong
armstrong.whit at gmail.com
Fri Jun 20 14:52:11 CEST 2014
I didn't see a separate mailing list for rcppredis, so posting here...
Does anyone know how to set a value with a space in it from rcppredis?
I can do it from the command line:
warmstrong at krypton:~/dvl/c++/redis.example$ redis-cli SADD hats 'my big hat'
(integer) 1
warmstrong at krypton:~/dvl/c++/redis.example$ redis-cli SMEMBERS hats
1) "my big hat"
but from R, my attempts with single quotes within double quotes and other
tricks do not work:
> redis$exec("SADD hats 'my other big hat'")
[1] 4
> redis$exec("SMEMBERS hats")
[[1]]
[1] "my big hat"
[[2]]
[1] "other"
[[3]]
[1] "'my"
[[4]]
[1] "big"
[[5]]
[1] "hat'"
>
If anyone knows the correct way to escape the quotes to get this to work,
that would be great.
Otherwise, it seems like I'm going to have to use the multi argument
version of redisCommand:
reply = redisCommand(c,"SADD %s %s", "hats", "my other big hat");
which is not yet exposed in rcppredis...
-Whit
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20140620/0e7ce2ac/attachment.html>
More information about the Rcpp-devel
mailing list