Annotate package titles and repository sources

annotate_repostitle(string_og)

Arguments

string_og

Text string (script) with package load calls.

Value

Text string with package titles and package repository source annotations. Will make note of packages not currently installed. Lines with existing comments or annotations are ignored by the regular expression that matches package names. Also ignores base packages.

Details

Some annotations may be long, check for possible line breaks introduced into your script.

Examples

test_string <- c("library(boot)\nrequire(lattice)")
annotate_repostitle(test_string)
#> [1] "library(boot) # Bootstrap Functions (Originally by Angelo Canty for S) CRAN v1.3-28.1\nrequire(lattice) # Trellis Graphics for R CRAN v0.21-8"