Hey
The size doesnt matter - so far. What your looking for is /read.csv()/ or
/read.csv2()/
A simple exemple would look like this:
name - read.csv2(C:/blablabla.../filename.csv, header=TRUE, sep=;,
dec=., na.strings=NA)
header = TRUE leaves a row for columne titles (i suppose ur columnes have
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
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.
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 results
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
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]
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)
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
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. Unfortunately, I'm
?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 Aldo
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:
On Fri, 21 Sep 2007, Gabor Csardi wrote:
I don't know a way of loading parts of an .RData file either,
You can't easily do it, as named objects are not stored separately in such
a file (nor in memory in R). See the 'R Internals' manual for a
description of the format. This would be
I don't know a way of loading parts of an .RData file either,
but another solution is to use the envir argument of load to
load the data into a new environment:
x - 1
y - rnorm(3)
save.image(tmp.RData)
rm(x)
rm(y)
load(tmp.RData, env - new.env())
get(x, env)
[1] 1
get(y, env)
[1]
13 matches
Mail list logo