Find words which contains all the vowels: Difference between revisions

m
→‎{{header|R}}: Variable removal.
(Added R.)
m (→‎{{header|R}}: Variable removal.)
Line 756:
<lang R>dict <- scan("https://web.archive.org/web/20180611003215/http://www.puzzlers.org/pub/wordlists/unixdict.txt", what = character())
dictBig <- dict[nchar(dict) > 10]
vowels#The <-following letters[lettersline %in%is equivalent to sapply(c("a", "e", "i", "o", "u")], function(x) stringr::str_count(dictBig, x))
#The following line is equivalent to sapply(vowels, function(x) stringr::str_count(dictBig, x))
#As with all things with strings in R, life is easier with stringr or stringi.
vowelCount <- sapply(vowelsc("a", "e", "i", "o", "u"), function(x) lengths(regmatches(dictBig, gregexec(x, dictBig))))
dictBig[apply(vowelCount, MARGIN = 1, function(x) all(x == 1))]</lang>
 
331

edits