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

Share:

Description

Find authors.

Usage

1
2
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 paramter. 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 seperate 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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
## 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: 
## http://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)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.