i have a textfile of an old spectrometer. It is encoded in "UTF-16LE" (I found this out with the readr:guess_encoding() function). I managed to read it in in base-r with:
spectra_gr2 <- read.csv("~/some/path/spectra.csv", header = F, encoding = "UTF-16LE", fileEncoding = "UTF-16LE", skipNul = T)
This works fine, but i want to do it using tidyverse/readr!
Does anyone know how i set the two options encoding/fileEncoding in read_delim() for Example?
Use it in locale
readr::read_delim("~/some/path/spectra.csv", delim = ",",
locale = readr::locale(encoding = "UTF-16LE"), col_names = FALSE)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With