Using read::read_csv() I find that some names with diacritical marks are encoded, but I'm having trouble figuring out how to get them back in their proper form for output.
For example, the name Renato Núñez in the file is stored in my data.frame as Renato N\xfa\xf1ez.
Is there a way to read them without encoding or, alternately, a way to convert the encoding back so the names are properly presented.
is not being UTF-8 encoded either in the source file or in the R environment
library(readr)
# external csv
# nombre
#Renato Núñez
#
#csv must have trailing blank line
read_csv("~/Desktop/nombre.csv")
#> Parsed with column specification:
#> cols(
#> nombre = col_character()
#> )
#> # A tibble: 1 x 1
#> nombre
#> <chr>
#> 1 Renato Núñez
Thanks for your reply, @technocrat. I see what you're saying.
The source of the data is an online CSV. When I copy and paste that data into my editor I correctly see Renato Núñez. But when I read it with read_csv() and inspect it, the same data is shown as Renato N˙Òez.
Copy/paste may not be reliable. Check the source encoding by downloading the csv and checking in the terminal with head, preferably. If the source encoding is correct, then the R client encoding needs to be adjusted.