-
-
Save MarkEdmondson1234/853831411169d554ec7f4d377d7e5dbb to your computer and use it in GitHub Desktop.
Revisions
-
mwhitaker created this gist
Jan 13, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,30 @@ --- title: "Host image files on Google Cloud storage" author: "Michael Whitaker" date: "January 12, 2017" output: html_document: self_contained: false --- ```{r setup, include=FALSE} library(knitr) library(googleCloudStorageR) opts_chunk$set(echo = TRUE) opts_knit$set(upload.fun = function(file) { upload_try <- gcs_upload(file, name = basename(file), predefinedAcl = "publicRead") paste0("https://storage.googleapis.com/BUCKETNAME/",upload_try$name) }) ``` ## R Markdown The function in the above chunk uploads any generated images and adds the src URL automatically in the generated HTML file. Just change to your **BUCKETNAME** This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>. When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this: ```{r cars} plot(cars) ```