Re: [R] importing large dataset

2011-10-26 Thread ManuelS
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

Re: [R] Importing Large Dataset into Excel

2007-12-12 Thread Prof Brian Ripley
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

Re: [R] Importing Large Dataset into Excel

2007-12-12 Thread Peter Dalgaard
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.

Re: [R] Importing Large Dataset into Excel

2007-12-12 Thread David Scott
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

Re: [R] Importing Large Dataset into Excel

2007-12-12 Thread Domenico Vistocco
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

Re: [R] Importing Large Dataset into Excel

2007-12-12 Thread Corey Sparks
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]

Re: [R] Importing Large Dataset into Excel

2007-12-12 Thread Julian Burgos
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)

Re: [R] Importing Large Dataset into Excel

2007-12-12 Thread Moshe Olshansky
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

[R] Importing Large Dataset into Excel

2007-12-11 Thread Wayne Aldo Gavioli
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

Re: [R] Importing Large Dataset into Excel

2007-12-11 Thread jim holtman
?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

Re: [R] Importing Large Dataset into Excel

2007-12-11 Thread Wayne Aldo Gavioli
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:

Re: [R] Importing a dataset

2007-09-25 Thread Prof Brian Ripley
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

Re: [R] Importing a dataset

2007-09-21 Thread Gabor Csardi
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]