Skip to content
/ jetpack Public
forked from ankane/jetpack

A friendly package manager for R

License

Notifications You must be signed in to change notification settings

EskDhg/jetpack

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Jetpack

🔥 A friendly package manager for R

  • Easy to use
  • Designed for reproducibility (thanks to Packrat, no more global installs!)
  • Great for collaboration
  • Secure by default

Screenshot

Inspired by Yarn and Bundler

Installing

Download the Jetpack CLI

curl https://raw.githubusercontent.com/ankane/jetpack/v0.1.0/jetpack > /usr/local/bin/jetpack
chmod +x /usr/local/bin/jetpack

With Homebrew, you can use:

brew install ankane/brew/jetpack

Getting Started

In your project directory, run:

jetpack init

This sets up Packrat and creates a DESCRIPTION file to store your dependencies.

If your project uses Git, packrat/lib*/ is added to your .gitignore.

Commands

Install

Install packages for a project

jetpack install

Whenever a teammate adds a new package, others just need to run this command to keep packages in sync. Do the same when a new member joins the project.

install is optional.

Add

Add a package

jetpack add dplyr

Add a specific version

jetpack add [email protected]

Due to a bug with devtools, packages added this way are reinstalled every time you run jetpack

Add from GitHub or another remote source

jetpack add dplyr --remote=github::tidyverse/dplyr

Supports all of these remotes

Update

Update a package

jetpack update dplyr

Remove

Remove a package

jetpack remove dplyr

Remove remotes as well

jetpack remove dplyr --remote=github::tidyverse/dplyr

Source Control

Be sure to commit all files Jetpack generates to source control, except for the packrat/lib*/ directories.

Deployment

Server

Install Jetpack on the server and run:

jetpack install

Docker

Create an init.R with:

install.packages("packrat")
source("packrat/init.R")
packrat::restore()

And add it into your Dockerfile:

FROM r-base

RUN apt-get update && apt-get install -qq -y --no-install-recommends \
  libxml2-dev libssl-dev libcurl4-openssl-dev

RUN mkdir -p /app
WORKDIR /app

COPY packrat ./packrat
COPY init.R ./
RUN Rscript init.R

COPY . .

CMD Rscript app.R

(no need to install Jetpack on the image)

Also, add packrat/lib*/ to your .dockerignore.

Heroku

There’s ongoing work to get Packrat working on Heroku.

History

View the changelog

Contributing

Everyone is encouraged to help improve this project. Here are a few ways you can help:

About

A friendly package manager for R

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • R 100.0%