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

MacQueen, Don macqueen1 at llnl.gov
Fri Feb 25 22:48:01 CET 2011


First off, I want to apologize for taking so long to respond, and thank
you for responding in the first place.

The LOCALE issue you pointed out is due to the fact that I normally run R
on Mac in a command line context (in a tcsh shell in an xterm window).

I tried the same commands in the R Console, wherein the LOCALE is more
Mac-like, and encountered the same error.

However, in the meantime I found a better approach to accomplishing my
task, so I have no need for a solution at this time. I can pursue the
question if you have an interest (after upgrading to R 2.12.2, of course).

-Don

-- 
Don MacQueen

Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062





On 1/31/11 10:57 PM, "Prof Brian Ripley" <ripley at stats.ox.ac.uk> wrote:

>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