Cleans a string by removing numbers, caesuras, punctuation, multiple whitespace, leading, and trailing whitespace.

clean_title(x)

Arguments

x

a character of length 1. A title extracted from a citation to clean.

Value

A character of length 1 with the extracted title. If the title cannot be detected, an empty string is returned.

Examples

ref <- paste0("Quainoo, A.K., Wetten, A.C., Allainguillaume, J., 2008. The ",
              "effectiveness of somatic embryogenesis in eliminating the ", 
              "cocoa swollen shoot virus from infected co- coa trees. ", 
              "J. Virol. Methods 149, 91e96.")
ref
#> [1] "Quainoo, A.K., Wetten, A.C., Allainguillaume, J., 2008. The effectiveness of somatic embryogenesis in eliminating the cocoa swollen shoot virus from infected co- coa trees. J. Virol. Methods 149, 91e96."

ref_title <- title_from_citation(ref)
ref_title
#> [1] " The effectiveness of somatic embryogenesis in eliminating the cocoa swollen shoot virus from infected co- coa trees"

clean_title(ref_title)
#> [1] "The effectiveness of somatic embryogenesis in eliminating the cocoa swollen shoot virus from infected cocoa trees"