Since Docker containers can hold any language within them, they offer a universal UI to combine languages. This offers opportunities to extend other languages with R features, and give other languages access to R code without needing to know R.
An example below uses:
gcloud
- Google's Cloud command line tool to access Google's key management store and download an authentication file, and pushes to BigQuerygago
- A Go package for fast downloads of Google Analytics dataR
- R code to create an Rmd file that will hold interactive forecasts of the Google Analytics data via cr_buildstep_r()
nginx
- serve up the Rmd files rendered into HTML and hosted on Cloud Run via cr_deploy_html()
And will perform downloading unsampled data from Google Analytics, creating a statistical report of the data and then uploading the raw data to BigQuery for further analysis.
An example of the demo output is on this Cloud Run instance URL:
https://polygot-demo-ewjogewawq-ew.a.run.app/polygot.html
It also uploads the data to a BigQuery table:
This constructed cloud build can also be used outside of R, by writing out the Cloud Build file via cr_build_write()
# write out to cloudbuild.yaml for other languages cr_build_write(polygot) # 2019-12-28 19:15:50> Writing to cloudbuild.yaml
This can then be scheduled as described in Cloud Scheduler section on scheduled cloud builds.
schedule_me <- cr_schedule_http(built) cr_schedule("polygot-example", "15 8 * * *", httpTarget = schedule_me)
An example of the cloudbuild.yaml is on GitHub here.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.