Skip to contents

Extract initialism Extract 1st letter of each word and delete all the other letters

Usage

extract_initialism(string)

Arguments

string

A character vector (e.g., a column in a data frame)

Value

A character vector

Examples

# Example 1
journal <- c("JOURNAL OF BIOLOGICAL CHEMISTRY",
             "Proteins: Structure, Function and Bioinformatics",
             "Archives of Biochemistry and Biophysics",
             "Clin Infect Dis",
             "Clinical Infectious Diseases",
             "CLINICAL INFECTIOUS DISEASES")

extract_initialism(journal)
#> [1] "JOBC"  "PSFAB" "AOBAB" "CID"   "CID"   "CID"  


# Example 2
journal_norm <- c("journal biological chemistry",
                  "proteins structure function bioinformatics",
                  "archives biochemistry biophysics",
                  "clin infect dis",
                  "clinical infectious diseases",
                  "clinical infectious diseases")

extract_initialism(journal_norm)
#> [1] "JBC"  "PSFB" "ABB"  "CID"  "CID"  "CID"