Skip to content

mrdrivingduck/api-r

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RDolphinDB Package

1. About

1.1 Description

This is a R-Package which will make it easy for you to handle DolphinDB with R.

It is implemented by R & C++, with the help of package Rcpp.

The package supports :

  • Running scripts
  • Executing functions with arguments
  • Uploading variables

on DolphinDB server, while receiving object from server in the form and type of R.

1.2 Dependency

  • R ( ≥ 3. 2. 0)
  • Rcpp ( ≥ 0. 12. 17)

2. How to use

2.1 Install R Environment

2.2 Get into R CMD

  • Type R in your terminal/console.
  • You should have set the correct environment variable and path for R.

2.3 Install devtools Package in R

  • In R CMD, type install.packages("devtools") to install package devtools.
  • Select the nearest mirror to download and install automatically.
  • Make sure the Internet is in good condition.

2.4 Install RDolphinDB Package by devtools

  • In R CMD, type devtools::install_github("dolphindb/api-r").
  • This command will automatically download and install RDolphinDB and its dependency package.
  • After installation, the package will be compiled and linked by g++ automatically.

2.5 Use the RDolphinDB Package

  • Assume you are running DolphinDB server on localhost:8848
  • Then you can use RDolphinDB in the following way
library(RDolphinDB)
conn <- dbConnect(DolphinDB(), "localhost", 8848)
if (conn@connected) {
    dbUpload(conn, c("val1", "val2"), list(3.5, c(1.3, 2.6, 3.7)))
    res_run <- dbRun(conn, "1 2 3")
    res_rpc <- dbRpc(conn, "size", list(c(1, 2, 3)))
    print(res_run)
    print(res_rpc)
}
dbClose(conn)

3. Documentation

3.1 In R CMD

# About the package
help(package = "RDolphinDB")

# About the functions
help("DolphinDB")
help("dbConnect")
help("dbRun")
help("dbRpc")
help("dbUpload")
help("dbClose")

3.2 Through our website


About

🐬 R-API of DolphinDB server.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 70.9%
  • R 28.0%
  • Other 1.1%