View source: R/gist_create_obj.R
gist_create_obj | R Documentation |
Create a gist from an R object
gist_create_obj( x = NULL, description = "", public = TRUE, browse = TRUE, pretty = TRUE, filename = "file.txt", ... )
x |
An R object, any of data.frame, matrix, list, character, numeric |
description |
(character) Brief description of gist (optional) |
public |
(logical) Whether gist is public (default: |
browse |
(logical) To open newly create gist in default browser
(default: |
pretty |
(logical) For data.frame and matrix objects, create
a markdown table. If FALSE, pushes up json. (default: |
filename |
Name of the file to create. Default: |
... |
Further args passed on to crul::verb-POST |
This function is specifically for going from R objects to a gist,
whereas gist_create()
is for going from files or executing code
gist_create()
, gist_create_git()
## Not run: ## data.frame ### by default makes pretty table in markdown format row.names(mtcars) <- NULL gist_create_obj(mtcars) gist_create_obj(iris) ### or just push up json gist_create_obj(mtcars, pretty = FALSE) ## matrix gist_create_obj(as.matrix(mtcars)) ## list gist_create_obj(apply(mtcars, 1, as.list)) ## character gist_create_obj("hello, world") ## numeric gist_create_obj(runif(10)) ## Assign a specific file name gist_create_obj(" ## header2 hey there!", filename = "my_markdown.md") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.