njdowdy / ixodes-tpt

Tick taxonomy for TPT project
GNU General Public License v3.0
0 stars 1 forks source link

Function to fix the Author (Converted from Python to R) #2

Closed vijaybarve closed 3 years ago

vijaybarve commented 3 years ago
# fix cases like: (Jordan & Rothschild), 1922
# regex: [x.replace(')', '')+')' for x in df$scientificNameAuthorship if re.search(r'[a-z]),', '', x)]

fixAuth <- function(x) ifelse(grepl('[a-z]),',x), paste(gsub(')', '',x),')',sep=''),x)

Jegelewicz commented 3 years ago

Nice. Applied to my code and works like a charm!