[R-SIG-Finance] Does anybody know how to connect to KDB from within R?

Daniel Cegielka daniel.cegielka at gmail.com
Thu Sep 24 23:54:04 CEST 2009


Brian G. Peterson pisze:
> Also, you may wish to read Dirk's post and related posts on the list
> archives here regarding POSIXct compatibility:
>
> http://dirk.eddelbuettel.com/blog/2009/02/03/#kdbplus_datetime_patch

http://groups.google.com/group/personal-kdbplus/browse_thread/thread/f3271f5cf534c67f

This patch is build in kdbplus.c (line: 470-489):

https://code.kx.com/trac/browser/kx/kdb%2B/interfaces/r/kdbplus.c


> Re: [R-SIG-Finance] Does anybody know how to connect to KDB from
within    R?

yes:

run: ~/q/l32/q -p 5000

R session:

# dyn.load(file.path("/home/kdeplus/.../q","l64"))
# con <-
.Call("kx_r_open_connection",list(host="localhost",as.integer(port=5000),user=NULL))
# execute <- function(con,query) {
  .Call("kx_r_execute",as.integer(con),query)
 }
# execute(con,"s:([] name:`A`B`C; var:10 20 30)")
# execute(con, "select from s")


best,
daniel cegielka



More information about the R-SIG-Finance mailing list