Finding Numeric Values of Strings using strsplit()
Given a random list of words, can you find which has the lowest or highest numerical value when we apply a basic number:letter cipher?
A while back I asked David how he would solve this problem:
Today’s post shows how to take a vector of words, parse them into each of the individual letters comprising the word, and calculate the sum of the value of the word using A=1, B=2, …, Z=26.
P.S. The code can be modified to find the answer (162) to:
To leave a comment
for the author, please follow the link and comment on his blog: is.R()
offers daily e-mail updates
news and tutorials
on topics such as: visualization (ggplot2
), programming (RStudio
, Web Scraping
) statistics (regression
, time series
) and more...
If you got this far, why not subscribe for updates
from the site? Choose your flavor: e-mail
, or facebook