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
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/repository.R
\name{as.data.frame.git_repository}
\alias{as.data.frame.git_repository}
\title{Coerce Git repository to a \code{data.frame}}
\usage{
\method{as.data.frame}{git_repository}(x, ...)
}
\arguments{
\item{x}{The repository \code{object}}
\item{...}{Additional arguments. Not used.}
}
\value{
\code{data.frame}
}
\description{
The commits in the repository are coerced to a \code{data.frame}
}
\details{
The \code{data.frame} have the following columns:
\describe{
\item{sha}{
The 40 character hexadecimal string of the SHA-1
}
\item{summary}{
the short "summary" of the git commit message.
}
\item{message}{
the full message of a commit
}
\item{author}{
full name of the author
}
\item{email}{
email of the author
}
\item{when}{
time when the commit happened
}
}
}
\examples{
\dontrun{
## 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.data.frame(repo)
df
}
}
|