[R] Read data in R

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Aug 24 09:17:51 CEST 2010


On Tue, 24 Aug 2010, jim holtman wrote:

> I sounds as if your data is encode as UTF-8.  You may need to specify
> the fileEncoding parameter on the read.table function.

Not UTF-8 ...  that's a BOM mark in UCS-2.   We don't have the 
sessionInfo() output that we asked for and this is an area where OSes 
do differ.   However, try fileEncoding = "UCS-2LE".

>
> On Mon, Aug 23, 2010 at 9:00 PM, Allie818 <alice.ly at gmail.com> wrote:
>>
>> I have a txt file with column data separated by commas.
>>
>> Subject,Sessionblock,LotteryImg,SubjectResp,Pictime,Bidtime,Voltage,ForcedAns
>> 10816,Session1,75_C2.jpg,No,7095,9548,Mid,Yes
>> 10816,Session1,25_C1.jpg,No,16629,18130,Low,Yes
>> 10816,Session1,5_C1.jpg,No,23217,24276,Low,Yes
>> 10816,Session1,75_C1.jpg,NULL,36359,-66179,Low,Yes
>> 10816,Session1,25_C2.jpg,NULL,49468,-66179,Mid,Yes
>> 10816,Session1,75_C3.jpg,Yes,60602,62119,High,Yes
>>
>> I have tried to read the data with this command
>> data<-read.table("/mrdata/embodied_val/data/Conditioning_TIM4_082310.txt",sep
>> = ",",header=T)
>>
>> but I get this error
>> Error in make.names(col.names, unique = TRUE) :
>>  invalid multibyte string at '<ff><fe>C'
>>
>> What am I doing wrong?
>>
>> Thanks,
>> Alice
>> --
>> View this message in context: http://r.789695.n4.nabble.com/Read-data-in-R-tp2336018p2336018.html
>> Sent from the R help mailing list archive at Nabble.com.
>>
>> ______________________________________________
>> 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.
>>
>
>
>
> -- 
> Jim Holtman
> Cincinnati, OH
> +1 513 646 9390
>
> What is the problem that you are trying to solve?
>
> ______________________________________________
> 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