Giter Club home page Giter Club logo

minicran's Introduction

miniCRAN

CRAN status R-CMD-check Code coverage CRAN RStudio mirror downloads

Create a mini version of CRAN containing only selected packages

Introduction

At the end of 2014, CRAN consisted of more than 6,000 packages, and by 2017 this number doubled to more than 12,000. Many organisations need to maintain a private mirror of CRAN, but with only a subset of packages that are relevant to them.

The miniCRAN package makes it possible to create an internally consistent repository consisting of selected packages from CRAN-like repositories. The user specifies a set of desired packages, and miniCRAN recursively reads the dependency tree for these packages, then downloads only this subset.

Important functions:

Function Use it for
pkgDep() Find package dependencies
makeRepo() Make repository (with or without downloading packages)
addPackage() Add additional packages (and their dependencies) to existing repository
updatePackages() Update the versions of packages currently in the repository

Installation:

Get the stable version from CRAN:

install.packages("miniCRAN")
library("miniCRAN")

Development version

Get the latest development version from github:

# Use `devtools` to install directly from github
library(devtools)
install_github("andrie/miniCRAN")

Example:

# Determine and download the packages `ggplot2`, `plyr` and `reshape2`, 
# including their dependencies:

library("miniCRAN")
pkgs <- c("ggplot2", "plyr", "reshape2")
makeRepo(pkgDep(pkgs), path = file.path(tempdir(), "miniCRAN"))

Supported by Microsoft

I started this project while employed by Revolution Analytics and Microsoft. Microsoft has kindly agreed that I maintain the project individually, and retains copyright to all work on the project until October 2017.

minicran's People

Contributors

achubaty avatar andrie avatar benmarwick avatar calligross avatar ethanwhite avatar jwood000 avatar kant avatar mungojam avatar ryanatanner avatar sebastian-c avatar vh-d avatar vnijs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

minicran's Issues

write wrappers or equivalent to easily manage packages for all three OSes

addPackages, updatePackages, makeRepo, etc. currently specify the package type as an argument.

Either:

  1. Create wrappers to these functions to be able to quickly add packages for all three types (.tar.gz, .zip, .tgz)
  2. Ensure these functions can handle a vector, e.g., type=c("source", "win.binary", ...)

I prefer the second option.

Remove long-running tests

CRAN requires all tests to run in fairly short amount of time.

  • Use devtools::skip_on_cran to test locally, but skip on CRAN.
  • Carefully choose package list to minimise dependencies, e.g. by using Matrix rather than raster in example_checkVersions.R

import `methods::is` into `twodigitRversion`

Need to import is from methods otherwise this function doesn't work when called from the commandline (e.g., using Rscript).

However, travis-ci autobuilds fail when methods::is is imported:

Namespace dependency not required: ‘methods’

merge `addPackage` and `add.packages.miniCRAN` functions

  1. new argument: download=TRUE specifies whether the package files should be downloaded from a CRAN-like repo.
  2. new argument: reindex.all=FALSE specifies whether the entire package index should be rebuilt based on the contents of the miniCRAN repo, or whether the index should simply be modified directly (more efficient).

location of `PACKAGES` and `PACKAGES.gz` incorrect in docs

The package index files should be written in the tips of the directory structure, in the same dir as the packages themselves.

In makeRepo.R:

#' @section Repo folder structure:
#' The folder structure of a repository

Specifies the structure as

  • root/
    • bin/
      • macosx/contrib/
      • windows/contrib/{version}
    • src/
      • contrib/
    • PACKAGES

But it should be:

  • root/
    • bin/
      • macosx/contrib/
        • PACKAGES
      • windows/contrib/{version}
        • PACKAGES
    • src/
      • contrib/
        • PACKAGES

Add ability to plot dependency graph

Features that would be useful in dependency graph include displaying information about:

  • "top level" packages
  • suggests, imports and depends
  • License

Add enhances option to pkgDep function?

Hi @andrie Should users have the option of asking for pkgs listed in the Enhances field of a pkg DESCRIPTION file? Doesn't seem to work when I do e.g. tools::package_dependencies("PivotalR", pdb, which="Enhances", recursive=TRUE)

improve groupings of functions using `@family`

Currently only @family miniCRAN functions is used for documentation. Since all of the package functions are included in the package help index, it makes more sense to specify more specific function groupings, such as "adding new packages", "dependency checking", etc.

Related: I really like the way the raster package groups their functions in the package documentation (see ?"raster-package").

fix file paths for all examples

Currently using backslashes to specify paths to examples in inst/examples/, which Windows is OK with but OSX and Linux are unable to build the package unless forward slashes are used.

However, travis-ci automated builds fail when forward slashes are used.

Improve documentation

General improvements:

  • Fix package title to comply with new CRAN rules (60 chars, title case, no ending period)
  • Expand description
  • Categorise functions in package documentation #19
  • Use @inheritParams to simplify documentation

Unsplit roxygen documentation lines

It's easier to edit and review roxygen if the documentation runs on a single line.

Most IDEs, and particularly RStudio allows soft line wrapping.

Having a single line makes it much easier to edit documentation, rather than having to continually re-split on edits.

Note: actual code should be split at ~80 chars

makeRepo error for mac.binary.mavericks

Great package @andrie !

I have been trying to create a miniCRAN repo for mavericks. When I use makeRepo, however, I get the following error:

Error in match.arg(type) :
'arg' should be one of “source”, “mac.binary”, “win.binary”

From the install.packages help file: Possible values are (currently) "source", "mac.binary", "mac.binary.mavericks" and "win.binary"

mac.binary.mavericks files are collected but the PACKAGES files is not. This is probably an issue in write_PACKAGES but I couldn't see how to fix it.

pkgDep fails if getOption("repos") is not a named vector

On my system, getOption("repos") is just a simple string:

> getOption("repos")
[1] "http://cran.revolutionanalytics.com"

This causes pkgDep to fail:

> miniCRAN:::pkgDep("ggplot2")
Error in if (repos["CRAN"] == "@CRAN@") { : 
  missing value where TRUE/FALSE needed

This command fixes the problem for me:

options(repos=c(CRAN="http://cran.revolutionanalytics.com"))

Create new function makeLibrary()

If the user simply wants a local library of packages, then makeRepo() is overkill.

Create the ability to download packages into a specified library location without creating the PACKAGES file.

new function to add a local package

Supplements adding packages from CRAN-like repo and GitHub.

Can be used with addOldPackage(..., writePACKAGES=FALSE) and, after a build of the package binaries on a local machine, should add the local files to the miniCRAN repo.

"local" packages here could mean package files on the local harddrive, a network location, and possibly a non-CRAN-like web location (so this would also work with prebuilt packages from Github or other site).

Seperate vignettes

Separate vignettes into:

  • Building a private repository using makeRepo
  • Using miniCRAN to identify package dependencies

Make igraph a suggested package

Given some recent reports of difficulties installing igraph, is it possible to modify the Imports to Enhances or `Suggests?

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.