git2r (version 0.10.1)

coerce-git_repository-method: Coerce Git repository to a data.frame

Description

The commits in the repository are coerced to a data.frame

Arguments

from
The repository object

Value

  • data.frame

Details

The data.frame have the following columns: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

Examples

Run this code
## Initialize a temporary repository
path <- tempfile(pattern="git2r-")
dir.create(path)
repo <- init(path)

## Create a user
config(repo, user.name="Alice", user.email="alice@example.org")

## Create three files and commit
writeLines("First file",  file.path(path, "example-1.txt"))
writeLines("Second file", file.path(path, "example-2.txt"))
writeLines("Third file",  file.path(path, "example-3.txt"))
add(repo, "example-1.txt")
commit(repo, "Commit first file")
add(repo, "example-2.txt")
commit(repo, "Commit second file")
add(repo, "example-3.txt")
commit(repo, "Commit third file")

## Coerce commits to a data.frame
df <- as(repo, "data.frame")
df

Run the code above in your browser using DataCamp Workspace