Code to calculate similarity between strings - R
Here is an implementation of the ideas I had suggested in the comments: to store the output of levenshteinSim so it is only called once, and to limit the expensive name comparisons to individuals that share the same initials. I hope it helps.

names_vec &lt;- data$nomeAlt
initials  &lt;- gsub("\\b(.).*?\\b", "\\1", x)

similar &lt;- list()
for (i in 1:length(names_vec)) {
   ini &lt;- initials == initials[i]
   sim &lt;- levenshteinSim(names_vec[i], names_vec[ini])
   idx &lt;- which(sim &gt; 0.85 &amp; sim != 1)
   similar[[i]] &lt;- if (length(idx) == 0) NA else ini[idx]
   print(i) # to get an update of the progress
}