-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathREADME.Rmd
More file actions
140 lines (103 loc) · 3.14 KB
/
Copy pathREADME.Rmd
File metadata and controls
140 lines (103 loc) · 3.14 KB
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
127
128
129
130
131
132
133
134
135
136
137
138
139
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
message = FALSE,
warning = FALSE,
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-"
)
```
# GitStats <img src="man/figures/GitStats_logo.png" align="right" height="138" style="float:right; height:138px;"/>
<!-- badges: start -->
[](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[](https://CRAN.R-project.org/package=GitStats)
[](https://CRAN.R-project.org/package=GitStats)
[](https://github.com/r-world-devs/GitStats/actions)
[](https://app.codecov.io/gh/r-world-devs/GitStats?branch=devel)
<!-- badges: end -->
With `GitStats` you can pull git data in a uniform way from GitHub and GitLab. For the time-being you can get data on:
- 🏛️ organizations,
- 📘 repositories,
- 🕒 commits,
- 🐛 issues,
- 🔂 pull requests,
- 🙍 users,
- 🚀 release logs,
- 🌲 files tree (structure),
- 📄 text files content.
You can also prepare basic statistics with `get_*_stats()` functions for commits and issues.
## Installation
From CRAN:
```r
install.packages("GitStats")
```
From GitHub:
```r
devtools::install_github("r-world-devs/GitStats")
```
## Examples:
Setup your `GitStats`:
```{r}
library(GitStats)
git_stats <- create_gitstats() |>
set_gitlab_host(
repos = "mbtests/gitstatstesting"
) |>
set_github_host(
orgs = "r-world-devs",
repos = "openpharma/DataFakeR"
)
```
Optionally, you can run `GitStats` functions in parallel (with `mirai` package underneath):
```{r}
git_stats |>
set_parallel()
```
Get commits:
```{r}
commits <- git_stats |>
get_commits(
since = "2022-01-01"
)
commits
commits |>
get_commits_stats(
time_aggregation = "month",
group_var = author
)
```
Get repositories with specific code:
```{r}
git_stats |>
get_repos(
with_code = "shiny",
add_contributors = FALSE
)
```
Get files:
```{r}
git_stats |>
get_files(
pattern = "\\.md",
depth = 2L
)
```
Get pull requests:
```{r}
git_stats |>
get_pull_requests(
since = "2022-01-01"
)
```
Print `GitStats` to see what it stores:
```{r}
git_stats
```
## See also
`GitStats` is used to facilitate workflow of the `GitAI` R package, a tool for gathering AI-based knowledge about git repositories: https://r-world-devs.github.io/GitAI/
## Acknowledgement
Special thanks to [James Black](https://github.com/epijim), [Karolina Marcinkowska](https://github.com/marcinkowskak), [Kamil Koziej](https://github.com/Cotau), [Matt Secrest](https://github.com/mattsecrest), [Krystian Igras](https://github.com/krystian8207), [Kamil Wais](https://github.com/kalimu), [Adam Forys](https://github.com/galachad) - for the support in the package development.