Coder Social home page Coder Social logo

rgallery's Introduction

rgallery: Build a Gallery of R Snippets

This package makes it easy to create an gallery for displaying small R vignettes, or "snippets". View an example here!

Installation

Install with devtools:

devtools::install_github("dgrtwo/rgallery")

You'll need Jekyll and git installed as well.

Usage

To create and edit your gallery, simply:

  1. Set up a gallery by running the following commands in R:

     library(rgallery)
     create_gallery("my-gallery")
     build_gallery("my-gallery")
    

This downloads the default r-gallery setup and builds it.

  1. Back in the command line, go into the directory and start a Jekyll server:

     cd my-gallery
     jekyll serve --watch
    
  2. Visit your local gallery at http://127.0.0.1:4000/.

  3. To create additional snippets, add .Rmd files to the _R directory. Make sure you include layout: snippet in the YAML header. Then do build_gallery("my-gallery") to compile them.

  4. To publish your gallery online for free, use GitHub pages: just make a public repository and push to the gh-pages branch. Note: You'll need to change the url parameter in _config.yml to http://<yourname>.github.io/<repo-name>.

That's all there is to it!

Additional customization

You can customize the global knitr options (for example, cache = TRUE or echo = FALSE) by adding to the knitr-options block in _config.yml:

# rgallery options
knitr-options:
  message: false

Future Plans

  • Categories and tags
  • Allowing multiple snippets to be connected, and therefore compiled in a row, to illustrate a larger topic or workflow
  • Allowing snippet submission, as a pull request to the repository, directly from R (i.e. submit_snippet('my_snippet.Rmd', repo = 'dgrtwo/big-gallery')). Preferably allow the repository owner to build and approve the snippet from within R as well.
  • Flexible front-ends, including alternatives to Jekyll

rgallery's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.