-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathREADME.Rmd
126 lines (88 loc) · 3.47 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
---
output: github_document
editor_options:
chunk_output_type: console
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
r_latest <- max(package_version(unique(rcheology::rcheology$Rversion)))
```
# rcheology
[![AppVeyor build status](https://ci.appveyor.com/api/projects/status/github/hughjonesd/rcheology?branch=master&svg=true)](https://ci.appveyor.com/project/hughjonesd/rcheology)
![runiverse-package badge](https://hughjonesd.r-universe.dev/badges/rcheology)
[![CRAN status](https://www.r-pkg.org/badges/version/rcheology)](https://cran.r-project.org/package=rcheology)
[![CRAN downloads](https://cranlogs.r-pkg.org/badges/rcheology)](https://cran.r-project.org/package=rcheology)
A data package which lists every command in base R packages since R version `r min(package_version(unique(rcheology::rcheology$Rversion)))`.
The latest R version covered is `r r_latest`.
You can view the data online in a [Shiny app](https://hughjonesd.shinyapps.io/rcheology/).
## Installing
From [r-universe](https://r-universe.dev):
```{r, eval = FALSE}
install.packages('rcheology', repos = c('https://hughjonesd.r-universe.dev',
'https://cloud.r-project.org'))
```
From CRAN:
```{r, eval = FALSE}
install.packages('rcheology')
```
```{r, child = "data-where-from.Rmd"}
```
## Do it yourself
* Install and start docker.
* Run `host-run-on-evercran.sh`.
## The data
```{r}
library(rcheology)
data("rcheology")
rcheology[rcheology$name == "kmeans" & rcheology$Rversion %in% c("1.0.1", "1.9.0", "2.1.0", "3.0.2", "3.2.0", "4.0.2"), ]
```
Latest changes:
```{r}
suppressPackageStartupMessages(library(dplyr))
r_penultimate <- sort(package_version(unique(rcheology::rcheology$Rversion)),
decreasing = TRUE)
r_penultimate <- r_penultimate[2]
r_latest_obj <- rcheology %>% dplyr::filter(Rversion == r_latest)
r_penult_obj <- rcheology %>% dplyr::filter(Rversion == r_penultimate)
r_introduced <- anti_join(r_latest_obj, r_penult_obj, by = c("package", "name"))
r_introduced
```
Base functions over time:
```{r}
library(ggplot2)
rvs <- rcheology$Rversion %>%
unique() %>%
as.package_version() %>%
sort() %>%
as.character()
major_rvs <- grep(".0$", rvs, value = TRUE)
major_rvs <- gsub("0.50", "0.50-a1", major_rvs)
major_rvs <- gsub("0.60", "0.60.0", major_rvs)
major_rv_dates <- Rversions$date[Rversions$Rversion %in% major_rvs]
major_rv_dates
major_rvs <- gsub("\\.0$", "", major_rvs)
rch_dates <- rcheology %>% left_join(Rversions, by = "Rversion")
ggplot(rch_dates, aes(date, group = package, fill = package), colour = NA) +
stat_count(geom = "area") +
theme(axis.text.x = element_text(angle = 45, hjust = 1, size = 8)) +
# ggthemes::scale_fill_gdocs() +
scale_x_date(breaks = major_rv_dates, labels = major_rvs) +
xlab("Version") + ylab("Function count") +
theme(legend.position = "top")
```
An alternative view:
```{r, fig.height = 8, out.height="1000px"}
ggplot(rch_dates, aes(date, fill = "orange")) +
stat_count(geom = "area") +
scale_x_date(breaks = major_rv_dates, labels = major_rvs) +
theme(axis.text.x = element_text(angle = 45, hjust = 1, size = 8)) +
xlab("Version") + ylab("Function count") +
facet_wrap(~package, scales = "free_y", ncol = 2) +
theme(legend.position = "none")
```