Am 27.08.2018 um 15:35 schrieb Sven Schreiber:
Am 27.08.2018 um 15:23 schrieb Allin Cottrell:
>
> I think the solution is (a) make sure your locale is set correctly
> within R, using Sys.setlocale() if need be, and (b) tell R that the
> incoming filename is in UTF-8. For the read.table() function this
> would be a matter of appending the argument 'encoding="utf-8"',
Hm, I'm having several doubts here: R's locale here is already set at
German_Germany.1252, which is correct AFAICT. But if I understand
correctly the filename on Windows on an NTFS disk is saved in UTF16? Not
sure how that is passed on to R by the OS.
> m <- as.matrix(read.table(fname, skip=1,
encoding-"utf-8"))
Next I believe the 'encoding' option in
read.table refers to the
contents of the file, not its name.
I have experimented with several things in R (iconv(), Encoding()), but
I'm not an R expert to know a lot about its non-Latin string handling,
so it hasn't worked. I guess I will go back to my old rule to only use
ASCII in file names... (In fact, I already have...)
thanks,
sven