I'm running a database with the following values:
data $ Col_Nova
I'm running a database with the following values:
data $ Col_Nova
You can change the entire column encoding at one time
dados$Col_Nova <- iconv(dados$Col_Velha, to = "latin1//TRANSLIT", from = "UTF-8")
You have put the backslashes
dados$Col_Nova <- sub(pattern = "[A-z].{2}cnic[A-z]\s.*", "Técnico de enfermagem", dados$Col_Nova)
Another alternative, which I consider more elegant, is to treat the file encoding in the load of the same, instead of fixing misconfigured load errors.
You can set the encoding in the file read, as follows:
csvFile <- file("arquivo.csv", encoding="UTF-8")
data <- read.csv(csvFile)
Following your case in the other comments, it's possible that the setting looks like this:
dados <- read.csv(file(arquivos[indice_arquivos], encoding="UTF-8"), header=T)
Since you did not post the full code, you can not guarantee it. But if it is not, it will be next to that.