[Rcpp-devel] rcppredis
Dirk Eddelbuettel
edd at debian.org
Fri Jun 20 18:38:01 CEST 2014
On 20 June 2014 at 08:52, Whit Armstrong wrote:
| I didn't see a separate mailing list for rcppredis, so posting here...
Fine by me. If anybody feels otherwise let me know (offlist) ...
| Does anyone know how to set a value with a space in it from rcppredis?
I haven't tried.
Filenames-with-spaces and all makes it a bad idea in my eyes :)
| 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.
Tried, and failed.
So far, with RcppRedis my approach has been to ... rely on rredis for
everything not time critical (like this, no?) and fill in code than needed to
be fast.
| 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...
Patches / pull requests welcome :)
Dirk
--
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org
More information about the Rcpp-devel
mailing list