forked from mmaechler/ProgRRR
-
Notifications
You must be signed in to change notification settings - Fork 0
/
packages-search.Rmd
33 lines (28 loc) · 983 Bytes
/
packages-search.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
---
title: "Packages in search()"
author: "Martin Maechler, ETH Zurich"
date: "March 7, 2016"
output: ioslides_presentation
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
```
## R Packages (that one slide of "Using R")
The default list of R objects (functions, some data sets) is actually not so small: Let's call `ls()` on each `search()` entry:
```{r functions, echo=TRUE}
ls.srch <- sapply(grep("package:", search(),
value=TRUE), # "package:<name>" entries
ls, all.names = TRUE)
fn.srch <- sapply(ls.srch, function(nm) {
nm[ sapply(lapply(nm, get), is.function) ] })
rbind(cbind(ls = (N1 <- sapply(ls.srch, length)),
funs = (N2 <- sapply(fn.srch, length))),
TOTAL = c(sum(N1), sum(N2))) -> res
```
i.e., `r sum(N2)` functions in
R version `r with(R.version, paste(major, minor, sep="."))`
(Past: had 2297 in version 2.11.1, 2348 in 2.14.0, 2332 in 3.0.2
----
```{r function show}
res
```