files: Files to upload. this or code param must be passed
description: (character) Brief description of gist (optional)
public: (logical) Whether gist is public (default: TRUE)
browse: (logical) To open newly create gist in default browser (default: TRUE)
code: Pass in any set of code. This can be a single R object, or many lines of code wrapped in quotes, then curly brackets (see examples below). this or files param must be passed
filename: Name of the file to create, only used if code
parameter is used. Default to code.R
knit: (logical) Knit code before posting as a gist? If the file has a .Rmd or .Rnw extension, we run the file with knit, and if it has a .R extension, then we use render
knitopts, renderopts: (list) List of variables passed on to knit, or render
include_source: (logical) Only applies if knit=TRUE. Include source file in the gist in addition to the knitted output.
imgur_inject: (logical) Inject imgur_upload
into your .Rmd file to upload files to https://imgur.com/. This will be ignored if the file is a sweave/latex file because the rendered pdf can't be uploaded anyway. Default: FALSE
rmarkdown: (logical) If TRUE, use rmarkdown::render() instead of knitr::knit() to render the document.
...: Further args passed on to verb-POST
Examples
## Not run:file <- tempfile()cat("hello world", file = file)gist_create(files=file, description='a new cool gist')file1 <- tempfile()file2 <- tempfile()cat("foo bar", file = file1)cat("foo bar", file = file2)gist_create(files=c(file1, file2), description='spocc demo files')# include any code by passing to the code parametergist_create(code={'
x <- letters
numbers <- runif(10)numbers
'})# Knit an .Rmd file before posting as a gistfile <- system.file("examples","stuff.Rmd", package ="gistr")gist_create(file, description='a new cool gist', knit=TRUE)file <- system.file("examples","plots.Rmd", package ="gistr")gist_create(file, description='some plots', knit=TRUE)# an .Rnw filefile <- system.file("examples","rnw_example.Rnw", package ="gistr")gist_create(file)gist_create(file, knit=TRUE)# Knit code input before posting as a gistgist_create(code={'
```{r}x <- letters
(numbers <- runif(8))