package_authors: Access (and clean) author elements from R's Rd file

View source: R/install.R

package_authorsR Documentation

Access (and clean) author elements from R's Rd file

Description

Find authors.

Usage

package_authors(
  package,
  to_strsplit = TRUE,
  split = c(",|and"),
  to_table = FALSE,
  ...
)

Arguments

package

a character string of the package we are interested in.

to_strsplit

logical (TRUE). Should the authors strings be split (in cases of a "and" or a comma ",")?

split

a character scalar to be passed to strsplit split parameter. default is c(",|and)

to_table

logical (FALSE). Should the authors strings be listed in a table - showing a count of how many .Rd files they were listed in? If not - a unique list is produced.

...

not used.

Details

List authors for a package from its "author" tag elements from its Rd files. The function also separate lists of authors, and cleans the output a bit (from spaces at the beginning of the strings).

Value

a character vector with a package authors (as extracted from the author tag in the .Rd files)

References

Useful for updating your DESCRIPTION file:

https://cran.r-project.org/doc/manuals/R-exts.html#The-DESCRIPTION-file

See Also

fetch_tag_from_Rd

Examples

## Not run: 

# before:
fetch_tag_from_Rd("installr", "\\author")
# after:
package_authors("installr")
sort(package_authors("installr")) # sorted name list...


## From the top R packages list: 
## https://www.r-statistics.com/2013/06/top-100-r-packages-for-2013-jan-may/
package_authors("plyr")
package_authors("digest")
package_authors("ggplot2")
package_authors("colorspace")
package_authors("stringr") # empty string.

package_authors("knitr")
package_authors("MASS")
package_authors("rpart")
package_authors("Rcpp")



## End(Not run)

installr documentation built on Nov. 13, 2022, 1:06 a.m.