forked from andrie/miniCRAN
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
77 lines (54 loc) · 2.75 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# miniCRAN <img src='man/figures/miniCRAN-logo.png' align="right" height="139" />
<!-- badges: start -->
[![R build status](https://github.com/andrie/miniCRAN/workflows/R-CMD-check/badge.svg)](https://github.com/andrie/miniCRAN/actions)
[![Code coverage](https://codecov.io/gh/andrie/miniCRAN/branch/master/graph/badge.svg)](https://codecov.io/gh/andrie/miniCRAN?branch=master)
[![CRAN version](http://www.r-pkg.org/badges/version/miniCRAN)](http://www.r-pkg.org/pkg/miniCRAN)
[![CRAN RStudio mirror downloads](http://cranlogs.r-pkg.org/badges/miniCRAN)](http://www.r-pkg.org/pkg/miniCRAN)
[![CRAN status](https://www.r-pkg.org/badges/version/miniCRAN)](https://cran.r-project.org/package=miniCRAN)
<!-- badges: end -->
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:
```r
install.packages("miniCRAN")
library("miniCRAN")
```
### Development version
Get the latest development version from github:
```r
# Use `devtools` to install directly from github
library(devtools)
install_github("andrie/miniCRAN")
```
## Example:
```r
# 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.