[R] Warnings about user error (was read.table error)
P Ehlers
ehlers at math.ucalgary.ca
Fri Dec 9 10:50:46 CET 2005
Eric,
Have you tried just copying your data from your email (this mail, e.g.)
to your preferred text editor, removing any mailer-inserted leading
characters, ensuring a newline at the end of the last line, and then
using read.table (perhaps via the clipboard if you're on Windows)?
Works for me with no warnings.
As Prof. Ripley said, your file must not have a newline at the end of
the last line. Your editor should let you display special characters.
Peter Ehlers
Eric C. Jennings wrote:
> Prof. Pipley
>
> First let me thank you for your help.
> Second, you are correct, I should not have used the word error in my subject
> line.
> Regarding the lack of detach(), I simply forgot to include that in my email.
> The warnings regarding the incomplete final line do not seem to want to go
> away.
> The masking messages
>
>>> The following object(s) are masked from ovendata ( position 4 ) :
>>>
>>> D Eight Five Four One Seven Three Two
>>>
>
> do go away if I use: rm(list=ls(all=TRUE))
>
> thanks,
> Eric
>
> ----- Original Message -----
> From: "Prof Brian Ripley" <ripley at stats.ox.ac.uk>
> To: "Eric C. Jennings" <matheric at u.washington.edu>
> Cc: <r-help at stat.math.ethz.ch>
> Sent: Wednesday, December 07, 2005 11:05 PM
> Subject: Re: [R] Warnings about user error (was read.table error)
>
>
>
>>I see no error here, let alone an error in read.table as claimed in your
>>subject line.
>>
>>The posting guide does specifically ask `Use an informative subject line'.
>>
>>Please distinguish warnings about _your_ usage from errors in R.
>>
>>The first warning is that R fixed up an error in your file: it is missing
>>a newline at the end of the last line (we can't see that in your listing).
>>
>>The remaining warnings come from attach() and say you have already
>>repeatedly attach()ed ovendata. Learn to use detach() to match attach().
>>Also, in attaching ovendata you mask the function D in package stats,
>>which is probably OK as you are not using it, and your D is a not a
>>function.
>>
>>
>>On Wed, 7 Dec 2005, Eric C. Jennings wrote:
>>
>>
>>>Hey, Once again I ask for some quick help.
>>>
>>>Here is some code:
>>>ovendata<- read.table("ovens.dat",header=TRUE)
>>>attach(ovendata)
>>>print(ovendata)
>>>
>>>Here is the .dat file:
>>>D One Two Three Four Five Seven Eight
>>>1130 254 252 375 384 252 375 876
>>>127 250 250 384 386 251 378 875
>>>
>>>Here is the R Console output:
>>>
>>>>ovendata<- read.table("ovens.dat",header=TRUE)
>>>
>>>Warning message:
>>>incomplete final line found by readTableHeader on 'ovens.dat'
>>>
>>>>attach(ovendata)
>>>
>>> The following object(s) are masked from ovendata ( position 3 ) :
>>>
>>> D Eight Five Four One Seven Three Two
>>>
>>>
>>> The following object(s) are masked from ovendata ( position 4 ) :
>>>
>>> D Eight Five Four One Seven Three Two
>>>
>>>
>>> The following object(s) are masked from ovendata ( position 5 ) :
>>>
>>> Eight Five Four One Seven Three Two
>>>
>>>
>>> The following object(s) are masked from package:stats :
>>>
>>> D
>>>
>>>
>>>>print(ovendata)
>>>
>>> D One Two Three Four Five Seven Eight
>>>1 1130 254 252 375 384 252 375 876
>>>2 127 250 250 384 386 251 378 875
>>>
>>>I've never seen anything like theis before. What's going on?
>>>
>>>Eric
>>>
>>>______________________________________________
>>>R-help at stat.math.ethz.ch mailing list
>>>https://stat.ethz.ch/mailman/listinfo/r-help
>>>PLEASE do read the posting guide!
>>>http://www.R-project.org/posting-guide.html
>>>
>>
>>--
>>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
>>
>
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
More information about the R-help
mailing list