[R] (no subject)

Petr PIKAL petr.pikal at precheza.cz
Mon Mar 10 14:48:09 CET 2008


Hi

r-help-bounces at r-project.org napsal dne 10.03.2008 13:00:39:

> If you have an original file in excel, the way I get such files is to 
> save them as csv (comma-separated), and then to use read.csv. Then 

Or if you do not have need to save the file just in Excel select data you 
want to transfer to R
press Ctrl - C

In R write
test <- read.delim("clipboard")

and you shall get test data frame. See ?read.delim

Regards
Petr

> these empty spots are more easily handled, since they correspond to 
> too successive commas.
> 
> Haris Skiadas
> Department of Mathematics and Computer Science
> Hanover College
> 
> 
> On Mar 10, 2008, at 7:26 AM, Alfons Sutter wrote:
> 
> > Thank you! I have the origenal file in MS-Excel, I save the excel 
> > file in a txt file. In the excel file there are missing value empty 
> > places for these missing value? Do I need to replace the empty 
> > places in a symbol for missing value and could you tell me place 
> > how can I avoid this warning message?
> >
> > Thank you in advance!
> >
> > ----- Original Message ----
> > From: Duncan Murdoch <murdoch at stats.uwo.ca>
> > To: Alfons Sutter <alfonssutter at yahoo.com>
> > Cc: r-help at stat.math.ethz.ch
> > Sent: Monday, March 10, 2008 12:18:11 PM
> > Subject: Re: [R] (no subject)
> >
> > On 10/03/2008 6:50 AM, Alfons Sutter wrote:
> >> Hi all,
> >>
> >> I am trying to read a text file in R! I have a warning message:
> >>
> >> In read.table(file = "data1.txt", header = T) : uncompleted last 
> >> line of readTableHeader in 'data1.txt'
> >
> > R is warning you that the file may be incomplete. In Unix, text files
> > are supposed to always end with a newline.  Windows programs often 
> > omit
> > it on the last line.  So on Unix, R is probably right to warn you, but
> > it could well be a false positive if you're on Windows.
> >
> >> Could you please tell me why? and how can I deal with missing 
> >> value when I read this file?
> >
> > How you deal with missing values really depends on what you want to do
> > with the data.  There's no general answer.
> >
> > Duncan Murdoch
> >
> 
> ______________________________________________
> 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.



More information about the R-help mailing list