parse_deps: Parse package dependency strings.

Description Usage Arguments Value Examples

View source: R/package-deps.r

Description

Parse package dependency strings.

Usage

1
parse_deps(string)

Arguments

string

to parse. Should look like "R (>= 3.0), ggplot2" etc.

Value

list of two character vectors: name package names, and version package versions. If version is not specified, it will be stored as NA.

Examples

1
2
3
parse_deps("httr (< 2.1),\nRCurl (>= 3)")
# only package dependencies are returned
parse_deps("utils (== 2.12.1),\ntools,\nR (>= 2.10),\nmemoise")

Example output

   name compare version
1  httr       <     2.1
2 RCurl      >=       3
     name compare version
1   utils      ==  2.12.1
2   tools    <NA>    <NA>
4 memoise    <NA>    <NA>

pkgload documentation built on April 6, 2021, 5:07 p.m.