Giter Site home page Giter Site logo

devtools's Introduction

devtools

The aim of devtools is to make your life as a package developer easy.

It does this by providing tools to:

  • simulate R CMD install during development (IN PROGRESS)
  • interactively run some parts of R CMD check
  • build documentation, run tests and benchmarking your code
  • help you release your package

These tools are described in more detail below.

Installation

While developing a package, you often want to reload all objects in the package without having to quit R, run R CMD install and then reopen. load_all will package dependencies described in DESCRIPTION, R code in R/, compiled shared objects in src/, data files in data/.

It keeps your global workspace clean by loading all objects into an environment called devel:package-name, and works efficiently by only reload files that have changed.

Referring to a package

All devtools functions as either a path or a name. If you specify a name it will load ~/.Rpackages, and try the path given by the default function, if it's not there, it will look up the package name in the list and use that path.

For example, a small section of my ~/.Rpackages looks like this:

list(
    default = function(x) {
      file.path("~/documents/", x, x)
    }, 

  "describedisplay" = "~/ggobi/describedisplay",
  "tourr" =    "~/documents/tour/tourr", 
  "mutatr" = "~/documents/oo/mutatr"
)

.Rprofile

To make it even easier to use, you might want to add the following lines to your .Rprofile:

if (interactive()) {
  suppressMessages(require(devtools))
  l <- function(pkg, ...) {
    pkg <- tolower(deparse(substitute(pkg)))
    
    
    load_all(pkg, ...)
  }  
}

That way you can reload any development package with the minimum of typing.

Make sure that there is a newline at the end of the file - otherwise R will (silently) ignore the if statement.

devtools's People

Contributors

hadley avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

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.