Code Monkey home page Code Monkey logo

pkgpeanuts's Introduction

pkgpeanuts

Author: Matthew Leonawicz gitter
License: MIT

Travis-CI Build Status AppVeyor Build Status Coverage Status

The intent of pkgpeanuts is to automate building out robust R package scaffolding for a newly created package. Create a new R package project with git in RStudio. Then let pkgpeanuts take care of the rest.

This package is in early development. It is not intended for operating on existing, developed packages; only new packages as newly created RStudio projects. It also does not work yet for creating new packages itself (difficulties with git and Windows), hence the instruction about creating a new project in RStudio first. Use at your own risk and/or read the source code.

Installation

You can install the development version of pkgpeanuts from GitHub with:

# install.packages("remotes")
remotes::install_github("leonawicz/pkgpeanuts")

Package setup

After creating a new local package project with git in RStudio, call pkgpeanuts::pour from the package root directory with your desired arguments. I suggest not doing this, however. Instead, use the convenient RStudio addin.

pkgpeanuts has many arguments. See the help documentation for details. And again, this is not intended for existing packages.

Special notes

This is relevant particularly for Windows users. I have not tested on other systems.

  • Must be in a new, local package project (using git) created in RStudio
  • Corresponding remote repository must not yet exist on GitHub (create remote repo error)
  • .Renviron must contain a valid GITHUB_PAT entry
  • For the time being, the addin (but not the pour function itself), will do the following:
cred <- git2r::cred_ssh_key(publickey = "~/../.ssh/id_rsa.pub", privatekey = "~/../.ssh/id_rsa")
usethis::use_github(credentials = cred)

This is the only way I currently have things functioning without errors.

Motivation

The primary motivation is for the convenient RStudio addin.

At each of my last two workplaces I have created workplace context-specific renditions of this package. This has enabled me to spin up new packages at work quickly and still have them conforming to professional standards and looking polished, despite limited time. By avoiding manually fussing with extraneous details that can be automated, I can focus on the fun part: building out the core package content. pkgpeanuts represents a generalization of my previous packages, stripping away code related to specific contexts. By design it must try to achieve less than my other packages did, but if generalized appropriately, could be useful to the R community.

This is largely a wrapper around a plethora of usethis functions, plus additional functions from pkgpeanuts. usethis has also received a number of significant developments recently, which has led to some new simplifications of things I no longer need to do myself when making packages.

pkgpeanuts's People

Watchers

James Cloos avatar Matt Leonawicz avatar

pkgpeanuts's Issues

Notes on pkgpeanuts and starters

I hope my taking notes here is ok. :-)

  • I think I see what your package does, which is adding best practice stuff to a very bare package skeleton. In starters we do most of these things by default (e.g. unit testing, README.Rmd), what we don't have are the other DESCRIPTION fields such as package dependencies.

  • If you look at the code of our add-in, we guess the GitHub account username via whoami, and the name of the author is added by usethis::create_package() directly thanks to the defaults one can set. One could actually store any DESCRIPTION fields in it, see https://usethis.r-lib.org/articles/articles/usethis-setup.html#store-default-values-for-description-fields-in-all-new-packages

  • I've gotten an error when running the add-in

Warning: Error in normalizePath: path[1]="/home/maelle/../.ssh/id_rsa.pub": No such file or directory

By the way our add-in returns the code run to the clipboard, might be useful for the user but also here for debugging for knowing exactly what I checked.

Cool project in any case, happy to see other folks building on usethis&co like we do. ๐Ÿ˜ธ

Why depend on R 3.5.0?

I've just removed the dependency to be able to install the package locally and was wondering whether there was a particular reason to depend on R 3.5.0. :-)

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.