Skip to contents

Extracts correct component from a splitted affiliation address

Usage

extract_split_address(splitted.address, string)

Arguments

splitted.address

The address splitted with stringr::str_split.

string

The keyword to determine which string component to keep.

Examples

address <- c(
  "Department of Psychology",
  " Cornell University",
  " Ithaca",
  " New York 14853-7601."
)

extract_split_address(address, "University")
#> [1] NA                   "Cornell University" NA                  
#> [4] NA                  
extract_split_address(address, "Department")
#> [1] "Department of Psychology" NA                        
#> [3] NA                         NA