Skip to contents

Pads missing canonical columns with NA, drops extra columns, sets Version to class package_version, converts all other non-character columns to character, and sets row names to "Package (Version)".

Usage

as_pkg_index(x)

Arguments

x

A matrix or data frame with some or all PACKAGES-style columns.

Value

A pkg_index data frame.

Examples

as_pkg_index(data.frame(Package = "foo", Version = "1.0"))
#>           Package Version Priority Depends Imports LinkingTo Suggests Enhances
#> foo (1.0)     foo     1.0     <NA>    <NA>    <NA>      <NA>     <NA>     <NA>
#>           License License_is_FOSS License_restricts_use OS_type Archs MD5sum
#> foo (1.0)    <NA>            <NA>                  <NA>    <NA>  <NA>   <NA>
#>           NeedsCompilation
#> foo (1.0)             <NA>