[R] list.files() error message: 'translateCharUTF8' must be called on a CHARSXP

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Feb 1 07:57:50 CET 2011


On Mon, 31 Jan 2011, MacQueen, Don wrote:

> I'm using list.files() on my home directory, like this:
>
>   crnt.files <- list.files(dir.to.check, full.names=TRUE, all.files=TRUE,
> recursive=TRUE)
>
> With dir.to.check set to the full path to my home directory.
>
> After a while I get:
>
> Error in list.files(dir.to.check, full.names = TRUE, all.files = TRUE,  :
>  'translateCharUTF8' must be called on a CHARSXP
>
> This happens on one of my two machines, not the other.
> Presumably there is a "file" somewhere in my home directory that, well,
> isn't a file?
> Or maybe has some strange character in its file name? That maybe isn't
> valid in my LOCALE?

Your guesses are wrong: this indicates internal corruption in R.

> I would appreciate some advice on how to find this "file" so I can get rid
> of it, or rename it, or something.
>
> Also, does this message possibly represent a problem that the R developers
> should pay attention to? I'm not sure.

They would need a reproducible example.  There is something odd, 
though: Mac OS X is not usually providing a C locale, nor in a C 
locale would translateCharUTF8 be called.  Does this happen if you set 
a standard Mac (UTF-8) locale?

>
> Thanks
> -Don
>
>
>> sessionInfo()
> R version 2.12.1 (2010-12-16)
> Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)
>
> locale:
> [1] C
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
>
>
> -- 
> Don MacQueen
> Environmental Protection Department
> Lawrence Livermore National Laboratory
> 925 423-1062
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list