Problem with reading file saved in directory

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with reading file saved in directory

Spencer Brackett
Good evening,

I set up a working directory to read the indicated desktop file, but
implementation of the read.file function produced the following error...

>meth = read.table(file = "~/Vakul's GBM code/mapper.txt", sep  ="\t",
header = T, row.names = 1)
Error in read.table(file = "~/Vakul's GBM code/mapper.txt", sep = "\t",  :
duplicate 'row.names' are not allowed
In addition: Warning message:
In scan(file = file, what = what, sep = sep, quote = quote, dec = dec,  :
  EOF within quoted string

What does it mean by "duplicate row names are not allowed" ? is the file I
am attempting to access somehow not compatible? Also, how do I address the
second part of the warning referring to what was found "In scan" ?

Best,

Spencer

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Reply | Threaded
Open this post in threaded view
|

Re: Problem with reading file saved in directory

Jeff Newmiller
My psychic powers are telling me you don't know what is in that file. Perhaps you should look, with an eye toward counting the number of fields on each line and on having properly-quoted fields. My psychic powers are not strong enough to tell you what problems you will find in that file.

On June 21, 2019 5:55:30 PM CDT, Spencer Brackett <[hidden email]> wrote:

>Good evening,
>
>I set up a working directory to read the indicated desktop file, but
>implementation of the read.file function produced the following
>error...
>
>>meth = read.table(file = "~/Vakul's GBM code/mapper.txt", sep  ="\t",
>header = T, row.names = 1)
>Error in read.table(file = "~/Vakul's GBM code/mapper.txt", sep = "\t",
> :
>duplicate 'row.names' are not allowed
>In addition: Warning message:
>In scan(file = file, what = what, sep = sep, quote = quote, dec = dec,
>:
>  EOF within quoted string
>
>What does it mean by "duplicate row names are not allowed" ? is the
>file I
>am attempting to access somehow not compatible? Also, how do I address
>the
>second part of the warning referring to what was found "In scan" ?
>
>Best,
>
>Spencer
>
> [[alternative HTML version deleted]]
>
>______________________________________________
>[hidden email] mailing list -- To UNSUBSCRIBE and more, see
>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.

--
Sent from my phone. Please excuse my brevity.

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Reply | Threaded
Open this post in threaded view
|

Re: Problem with reading file saved in directory

R help mailing list-2
In reply to this post by Spencer Brackett
Reading the file with row.names=1 meant to make rownames out of the first
column in the text file.  Duplicate row names are not accepted.  To
diagnose, read it with row.names=NULL and see what is in the first column
(e.g., use the table function on it).

Bill Dunlap
TIBCO Software
wdunlap tibco.com


On Fri, Jun 21, 2019 at 3:56 PM Spencer Brackett <
[hidden email]> wrote:

> Good evening,
>
> I set up a working directory to read the indicated desktop file, but
> implementation of the read.file function produced the following error...
>
> >meth = read.table(file = "~/Vakul's GBM code/mapper.txt", sep  ="\t",
> header = T, row.names = 1)
> Error in read.table(file = "~/Vakul's GBM code/mapper.txt", sep = "\t",  :
> duplicate 'row.names' are not allowed
> In addition: Warning message:
> In scan(file = file, what = what, sep = sep, quote = quote, dec = dec,  :
>   EOF within quoted string
>
> What does it mean by "duplicate row names are not allowed" ? is the file I
> am attempting to access somehow not compatible? Also, how do I address the
> second part of the warning referring to what was found "In scan" ?
>
> Best,
>
> Spencer
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> 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.
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Reply | Threaded
Open this post in threaded view
|

Re: Problem with reading file saved in directory

Spencer Brackett
Thank you Mr. Dunlap, that was very helpful!

On Fri, Jun 21, 2019 at 8:01 PM William Dunlap <[hidden email]> wrote:

> Reading the file with row.names=1 meant to make rownames out of the first
> column in the text file.  Duplicate row names are not accepted.  To
> diagnose, read it with row.names=NULL and see what is in the first column
> (e.g., use the table function on it).
>
> Bill Dunlap
> TIBCO Software
> wdunlap tibco.com
>
>
> On Fri, Jun 21, 2019 at 3:56 PM Spencer Brackett <
> [hidden email]> wrote:
>
>> Good evening,
>>
>> I set up a working directory to read the indicated desktop file, but
>> implementation of the read.file function produced the following error...
>>
>> >meth = read.table(file = "~/Vakul's GBM code/mapper.txt", sep  ="\t",
>> header = T, row.names = 1)
>> Error in read.table(file = "~/Vakul's GBM code/mapper.txt", sep = "\t",  :
>> duplicate 'row.names' are not allowed
>> In addition: Warning message:
>> In scan(file = file, what = what, sep = sep, quote = quote, dec = dec,  :
>>   EOF within quoted string
>>
>> What does it mean by "duplicate row names are not allowed" ? is the file I
>> am attempting to access somehow not compatible? Also, how do I address the
>> second part of the warning referring to what was found "In scan" ?
>>
>> Best,
>>
>> Spencer
>>
>>         [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
>> 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.
>>
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.