Skip to content

Instantly share code, notes, and snippets.

@kokes
Last active January 7, 2016 22:46
Show Gist options
  • Save kokes/dee2e0715348247510f5 to your computer and use it in GitHub Desktop.
Save kokes/dee2e0715348247510f5 to your computer and use it in GitHub Desktop.
# Pěkný to neni, ale zdá se že funguje
# edit: případně vlastně můžem embednout iconv do argumentu gsubu
paste0(unlist(lapply(strsplit(Z, "'")[[1]], function(a) {gsub("'","",iconv(a, to='ASCII//TRANSLIT'))})), collapse="'")
# > Z="příliš žluťoučký 'kůň' s 'apostrofama'"
# > paste0(unlist(lapply(strsplit(Z, "'")[[1]], function(a) {gsub("'","",iconv(a, to='ASCII//TRANSLIT'))})), collapse="'")
# [1] "prilis zlutoucky 'kun' s 'apostrofama"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment