% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/db.R
\name{reformat_db}
\alias{reformat_db}
\title{Format the package database}
\usage{
reformat_db(db, version = NULL)
}
\arguments{
\item{db}{A data frame returned from \code{\link[utils:available.packages]{utils::available.packages()}} or \code{\link[utils:installed.packages]{utils::installed.packages()}}.}

\item{version}{Version of the database, a self-defined text.}
}
\value{
A \code{pkg_db} object. There are the following methods:
\itemize{
\item \code{pkg_db$get_meta(package, field = NULL)} \code{field} can take values in "Package", "Version" and "Repository".
\item \code{pkg_db$get_dependency_table(package)} Get the dependency table.
\item \code{pkg_db$get_rev_dependency_table(package)} Get the reverse dependency table.
\item \code{pkg_db$package_dependencies(package, recursive = FALSE, reverse = FALSE, which = "strong", simplify = FALSE)} All the arguments are the same as in \code{\link[tools:package_dependencies]{tools::package_dependencies()}}. Argument \code{simplify} controls whether to return a data frame or a simplied vector.
}
}
\description{
Format the package database
}
\details{
It reformats the data frame of the package database into a \code{pkg_db} object.
}
\examples{
\dontrun{
db = available.packages()
db2 = reformat_db(db)
}
}
