write.table only writes the first 256 variables/columns
You cannot increase the column/field limit in any of the MS Office products. At least for the desktop MS applications (and presumably for all ODBC based driver interactions) there is a 255 column limit in the CREATE TABLE SQL query as part of the ODBC limitations. A reference is here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/odbcjetsdk_149.asp The major changes in recent versions of Excel relative to sheet size was to increase the number of rows, which in Excel XP (2002) is 65,536 rows by 256 columns. HTH, Marc Schwartz
On Fri, 2003-05-23 at 10:02, Giles Innocent wrote:
Excel only imports the first 256 columns as standard (not sure if you can increase this). I had a similar problem importing a database recently - I just gave up using Excel, used R instead. Giles On 2003.05.23 15:43 Stuart Leask wrote:
Thanks. I was "believing" an Excel import of the file - as you say, a re-import into R still has 333 columns. I shall look elsewhere for the cause of the mysterious truncation. Stuart
----- Original Message ----- From: "Thomas Lumley" <tlumley at u.washington.edu> To: "Stuart Leask" <stuart.leask at nottingham.ac.uk> Cc: "R-Help" <r-help at stat.math.ethz.ch> Sent: Friday, May 23, 2003 2:50 PM Subject: Re: [R] write.table only writes the first 256
variables/columns
On Fri, 23 May 2003, Stuart Leask wrote:
Hi there. Using read.spss I can read in a file 333 columns, 280 lines, but
if I
use
write.table to export it, I only get 256 columns x 280 lines. I
can't
find
this feature documented anywhere...
I can't replicate this:
foo<-matrix(rnorm(333*280), ncol=333, nrow=280)
foo<-as.data.frame(foo)
write.table(foo,"foo.txt")
bar<-read.table("foo.txt",header=TRUE)
dim(bar)
[1] 280 333
all.equal(foo,bar)
[1] TRUE and I can't see why it would be true. Does this example work for
you?
The largest SPSS file I have lying around has only 212 columns,
so I
can't test the read.spss aspect of it. -thomas
______________________________________________ R-help at stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
______________________________________________ R-help at stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help