This is an R package that wraps Domo’s REST API. This package is DBI-compliant.
And the development version from GitHub with:
# install.packages("devtools")
devtools::install_github("shunsambongi/domo")
This is a basic example which shows you how to solve a common problem:
library(domo)
con <- dbConnect(domo())
dataset_id <- dbCreateTable(con, "iris", iris)
# dataset ID will also be available in the dataset URL
# e.g. b06e0040-9aa6-11ea-8515-f76f845b5ce6
dbWriteTable(con, dataset_id, iris, overwrite = TRUE)
dbReadTable(con, dataset_id)
dbplyr support is experimental.
library(dplyr)
tbl(con, "b06e0040-9aa6-11ea-8515-f76f845b5ce6") %>%
select(Sepal.Length, Sepal.Width, Species) %>%
mutate(Sepal.Sum = Sepal.Length + Sepal.Width) %>%
group_by(Species) %>%
summarise(Max.Sepal.Sum = max(Sepal.Sum, na.rm = TRUE)) %>%
ungroup() %>%
filter(Species == "setosa")
Create credentials by logging in at Domo’s developer
website, and creating a new
client. The client will need the
data
application scope.
After creating your client, set the environment variables
DOMO_CLIENT_ID
and DOMO_CLIENT_SECRET
to the client’s ID and secret
values from the client’s
webpage.
If you need to connect to Domo using multiple clients with different
permission scopes, or you need to connect to multiple Domo instances,
pass the client ID and secret values to the dbConnect
method directly:
con1 <- dbConnect(domo::domo(), "<client id 1>", "<client secret 1>")
con2 <- dbConnect(domo::domo(), "<client id 2>", "<client secret 2>")