[R] Problem with read.table()

Gabor Grothendieck ggrothendieck at gmail.com
Thu Oct 2 15:20:24 CEST 2008


Did you try skipping the header as one respondent mentioned?
read.table(..., skip = 1, header = FALSE)

On Thu, Oct 2, 2008 at 9:05 AM, Joan-Josep Vallbé <Pep.Vallbe at uab.cat> wrote:
> Hi, I've done ?count.fields and it helped me identify a blank space that I
> had not noticed (thanks!), but when I try to upload the table again with
>
> ayuso <- read.table("/Users/user/Rwork/ayusotriada.txt", header=TRUE,
> sep="\t", na.strings="NA", dec=".", strip.white=TRUE)
>
> or with read.delim, the error message "Error with make.names(col.names,
> unique =
>>
>>> TRUE) :
>>> string multibyte 187 invalid
>
> still appears. thanks!
>
>
>
> On 02/10/2008, at 14:30, Gabor Grothendieck wrote:
>
>> Look at ?count.fields to diagnose this.
>>
>> On Thu, Oct 2, 2008 at 8:05 AM, Joan-Josep Vallbé <pep.vallbe at uab.cat>
>> wrote:
>>>
>>> Hi, I've tried it with read.delim:
>>>
>>> ayuso <- read.delim("/Users/user/Rwork/ayusotriada.txt")
>>>
>>> and now the error message is "Error with make.names(col.names, unique =
>>> TRUE) :
>>> string multibyte 187 invalid"
>>>
>>> thanks!
>>>
>>>
>>>
>>> On 02/10/2008, at 12:21, Joan-Josep Vallbé wrote:
>>>
>>>> Hello everybody,
>>>>
>>>> I'm a new user and I'm trying to use read.table with a tab delimited
>>>> file but the system tells me (i) that there are more columns than
>>>> column names, and (ii) that headers and col.names are of different
>>>> lengths. I have already checked my variable names and there's no blank
>>>> spaces. However, some variables have quite long names such as
>>>> "valoracion.experiencias.segundo.year". Could it be the problem? If
>>>> that is the case, I still don't understand why I have more columns
>>>> that column names. Could anyone help me with that?
>>>>
>>>> Thank you very much!
>>>>
>>>>
>>>> Joan-Josep Vallbé
>>>> Institute of Law and Technology
>>>> Political Science Department
>>>> Autonomous University of Barcelona (UAB)
>>>> pep.vallbe at uab.es
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>      [[alternative HTML version deleted]]
>>>>
>>>> ______________________________________________
>>>> 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.
>>>
>>> Joan-Josep Vallbé
>>> Institute of Law and Technology
>>> Political Science Department
>>> Autonomous University of Barcelona (UAB)
>>> pep.vallbe at uab.es
>>>
>>> ______________________________________________
>>> 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.
>>>
>
> Joan-Josep Vallbé
> Institute of Law and Technology
> Political Science Department
> Autonomous University of Barcelona (UAB)
> pep.vallbe at uab.es
>
>
>
>
>
>



More information about the R-help mailing list