[18931] in s-news-athena
[S] S-PLUS 2000 dataframe/datasheet botch with import.data
daemon@ATHENA.MIT.EDU (David O. Nelson)
Thu Aug 12 19:14:42 1999
Message-Id: <4.2.0.58.19990812134744.00a78900@poptop.llnl.gov>
Date: Thu, 12 Aug 1999 16:11:54 -0700
To: s-news@wubios.wustl.edu
From: "David O. Nelson" <daven@llnl.gov>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"; format=flowed
Here's yet another bug-inducing "feature" added to S-PLUS 2000:
A warning about importing Excel spreadsheets into S-PLUS 2000 when the
"default class" is data.sheet...
If the LAST ROW of the spreadsheet contains one or more fields with missing
values, then
1. Each column is truncated so that any missing values at the end of the
column are elided, so columns with missing values have a length() that is
shorter than the number of rows in the spreadsheet;
2. Any function like table(), which insists that its argument vectors be
the same length, will fail. Other functions won't fail, just produce
cryptic error messages about nonconforming lengths;
3. The length of each offending column will depend on the order in which
the rows are present in the spreadsheet!
SPECIAL NOTE:
The "obvious" work-around, changing Options:General Settings:default class
to "data.frame" instead of "data.sheet", causes S-PLUS to throw an
exception violation, unceremoniously dump core, and disappear whenever it
tries to import an Excel spreadsheet with missing data in the last row. So,
the actual work-around is to keep the default class as "data.sheet" and
coerce the data sheet afterwards into a data frame via as.data.frame().
This problem doesn't seem to exist with text files, just Excel spreadsheets.
In any event, who out there has a use for "data sheets"? From my myopic
point of view, their cost-benefit ratio is approximately plus infinity.
----
David O. Nelson
Lawrence Livermore National Laboratory
Box 808, L-452
Livermore CA 94551
Ph: (925) 423-8898 Fax: (925) 422-2282
-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news