https://github.com/r-world-devs/gitstats
An R package to get statistics from GitHub and GitLab.
https://github.com/r-world-devs/gitstats
git github gitlab metadata r
Last synced: 11 months ago
JSON representation
An R package to get statistics from GitHub and GitLab.
- Host: GitHub
- URL: https://github.com/r-world-devs/gitstats
- Owner: r-world-devs
- License: other
- Created: 2023-01-09T14:02:20.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2024-10-29T08:05:05.000Z (over 1 year ago)
- Last Synced: 2024-10-29T09:23:08.053Z (over 1 year ago)
- Topics: git, github, gitlab, metadata, r
- Language: R
- Homepage: https://r-world-devs.github.io/GitStats/
- Size: 17 MB
- Stars: 3
- Watchers: 5
- Forks: 1
- Open Issues: 87
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
- License: LICENSE
Awesome Lists containing this project
README
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
message = FALSE,
warning = FALSE,
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-"
)
```
# GitStats 
[](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[](https://github.com/r-world-devs/GitStats/actions)
[](https://app.codecov.io/gh/r-world-devs/GitStats?branch=devel)
With GitStats you can pull git data in a uniform way (table format) from GitHub and GitLab. For the time-being you can get data on:
* repositories,
* commits,
* users,
* release logs,
* text files content,
* R package usage.
## 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"
)
```
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 package usage:
```{r}
git_stats |>
get_R_package_usage(
packages = c("shiny", "purrr"),
split_output = TRUE
)
```
Print `GitStats` to see what it stores:
```{r}
git_stats
```
## 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.