EPM_auth_parse: Parse and Format Author Names and Affiliations.

View source: R/epm_all_fx.R

EPM_auth_parseR Documentation

Parse and Format Author Names and Affiliations.

Description

Extract Author Information form a slice of a raw XML PubMed record. Last Name, First Name, Address and emails are returned. Only the first address of each author is returned. A collapsed version of the author list is also returned.

Usage

EPM_auth_parse(x, max_authors = 15, autofill = TRUE)

Arguments

x

String (character vector of length 1) including an XML Author List section from a PubMed record.

max_authors

Numeric, maximum number of authors to include. See details for additional information.

autofill

Logical, shall non-missing address information be propagated to fill missing address information for other authors in the same publication.

Details

The value of the 'max_authors' argument should be tuned to control which author information to extract from the input. If 'max_authors' is set to '0', no author information are extracted. If 'max_authors' is set to '-1' (or any negative number), only information corresponding to the last author are extracted. If 'max_authors' is set to '+1', only the first author information are extracted. If 'max_authors' is set to any other positive integer, only information for the indicated number of authors is extracted. In this case, information for both the first and the last author will be included.

Value

list including 2 elements: 'authors' is a data.frame including one row for each author and n=4 columns: lastname, forename, address and email; 'collapsed' is a list including 2 elements (each element is a string): authors and address.

Author(s)

Damiano Fantini, damiano.fantini@gmail.com

References

https://www.data-pulse.com/dev_site/easypubmed/

Examples

aff <- paste0('<Author><LastName>Doe</LastName><ForeName>John</ForeName>', 
              '<Affiliation>Univ A</Affiliation></Author>',
              '<Author><LastName>Doe</LastName><ForeName>Jane</ForeName>', 
              '<Affiliation>jane_doe@univ_a.edu</Affiliation></Author>',
              '<Author><LastName>Foo</LastName><ForeName>Bar</ForeName>', 
              '<Affiliation>Univ B</Affiliation></Author>')
easyPubMed:::EPM_auth_parse(aff)




dami82/easyPubMed documentation built on Jan. 4, 2024, 6:21 a.m.