Pull data from Looker with the 3.0 API.
if (!require("devtools")) { install.packages("devtools") }
devtools::install_github("avantcredit/looker3")
Before pulling data from Looker, you need to set up environment variables LOOKER_URL, LOOKER_ID, and LOOKER_SECRET with the url to your Looker instance, your client id, and your client secret respectively.
Once those are set up, you can access data using the looker3
function:
library("looker3")
df <- pull_data(model = "thelook",
view = "orders",
fields = c("orders.count", "orders.created_month")
filters = list("orders.created_month" = "90 days", "orders.status" = "complete")
)
There are two ways to specify filters. As a list, as illustrated above As a vector, using a colon as a separator, e.g.
filters = c("orders.created_month: 90 days", "orders.status: complete")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.