Creating gists in
gistr can be done with any of
gist_create()- Create gists from files or code blocks, using the GitHub HTTP API. Because this function uses the GitHub HTTP API, it does not work for binary files. However, you can get around this for images by using knitr's hook to upload images to eg., imgur. In addition, it's difficult to include artifacts from the knit-ing process.
gist_create_git()- Create gists from files or code blocks, using git. Because this function uses git, you have more flexibility than with the above function: you can include any binary files, and can easily upload all artifacts.
gist_create_obj()- Create gists from R objects: data.frame, list, character string, matrix, or numeric. Uses the GitHub HTTP API.
It may seem a bit odd to have three separate functions for creating gists.
gist_create() was created first, and was out for a bit, so when
we had the idea to create gists via git (
from R objects (
gist_create_obj()), it made sense to have a
different API for creating gists via the HTTP API, git, and from R objects.
We could have thrown everything into
gist_create(), but it would
have been a massive function, with far too many parameters.