This is how I would approach it.
library(stringr)
m <- your_vector
m <- tolower(m) # normalize strings
m <- gsub(",","",m) # drop punctuation
m <- gsub("$","",m) # other punctuation as necessary
m <- gsub("\\s","",m) # drop spaces
dat <- data.frame(raw = m)
dat$words <- str_extract(m,"[a-z].*") # extract words
dat$numbers <- str_extract(m,"[0-9]*") # extract numbers
Then create a new data.frame from unique(dat$words), merge, and multiply.
dat_merge <- data.frame(
words = unique(dat$words),
multiplier = c(1e6,1e6) # from LOOKING at unique(dat$words)
) # new df
dat <- merge(dat, dat_merge)
dat$value <- dat$multiplier * dat$numbers
dat$value
I particularly like this approach, because you can easily update it over time. Especially when you have new formats. I use it personally in a lot of projects for verbatim company names, and some other small text elements.