/12/2007 6:09 PM
To: Wayne Aldo Gavioli
Cc: r-help@r-project.org
Subject: Re: [R] Importing Large Dataset into Excel
Hi Wayne,
I'm assuming that you file is really a comma-separated file (*.csv) and
not an Excel workbook (*.xls) saved with a .csv extension, right? That
(in my experien
One can also do:
x <- readLines("newborn edit.csv",n=529)
and examine x[528] (or x[529] - depending on whether
line 528 was line 528 of the file or line 528 after
reading the header line).
--- Julian Burgos <[EMAIL PROTECTED]> wrote:
> Hi Wayne,
>
> I'm assuming that you file is really a
> com
Hi Wayne,
I'm assuming that you file is really a comma-separated file (*.csv) and
not an Excel workbook (*.xls) saved with a .csv extension, right? That
(in my experience) is a common mistake.
You should open your file with a simple text editor (notepad will do if
the file is not too large) an
Did you try read.xls() in the xlsReadWrite library, I have had good success
with this.
Corey
Corey S. Sparks, Ph.D.
Assistant Professor
Department of Demography and Organization Studies
University of Texas San Antonio
One UTSA Circle
San Antonio, TX 78249
email:[EMAIL PROTECTED]
[[a
If you are using a windows system you could take a look at the
xlsReadWrite packages (there are functions for reading xls files).
domenico
jim holtman wrote:
> ?count.fields
>
> count.fields will tell you how many items are in each line. As you
> said, they should all be the same, but this will
On Wed, 12 Dec 2007, Peter Dalgaard wrote:
> Philippe Grosjean wrote:
> The problem is often a misspecification of the comment.char argument.
> For read.table(), it defaults to '#'. This means that everywhere you
> have a '#' char in your Excel sheet, the rest of the line is ignored.
> This res
Philippe Grosjean wrote:
> The problem is often a misspecification of the comment.char argument.
> For read.table(), it defaults to '#'. This means that everywhere you
> have a '#' char in your Excel sheet, the rest of the line is ignored.
> This results in a different number of items per line.
I would say that the issue is more often the character ', which is allowed
as a quote in read.table and not in read.csv.
As for
>>> Also, is there an easier way to import data from R into Excel
>>> using a single line of R code?
I think it means import from Excel into R, and there are several s
The problem is often a misspecification of the comment.char argument.
For read.table(), it defaults to '#'. This means that everywhere you
have a '#' char in your Excel sheet, the rest of the line is ignored.
This results in a different number of items per line.
You should better use read.csv()
Sorry, the title of this should read "From Excel into R".
Quoting Wayne Aldo Gavioli <[EMAIL PROTECTED]>:
>
> Hello all,
>
>
> I seem to be having a problem importing a data set from Excel into R. I'm
> using
> the "read.table" command to import the data with the following line of code:
>
> > n
?count.fields
count.fields will tell you how many items are in each line. As you
said, they should all be the same, but this will confirm it.
field.count <- count.fields("newborn edit.csv", sep=",")
table(field.count) # determine count of the fields on a line
On Dec 11, 2007 7:15 PM, Wayne Ald
Hello all,
I seem to be having a problem importing a data set from Excel into R. I'm using
the "read.table" command to import the data with the following line of code:
> newborn<-read.table("newborn edit.csv", header=T, sep=",")
where "newborn edit.csv" is the name of the file. Unfortunatel
12 matches
Mail list logo