Skip to content
Prev 83365 / 398513 Next

Problem Reading SPlus Dump Into R - Spaces Embedded in Data

allan miller <amiller at a2software.com> writes:
As I suspected, your data are not in the format that you thought they
were. 

turmalin:~/>Splus
S-PLUS : Copyright (c) 1988, 2003 Insightful Corp.
S : Copyright Lucent Technologies, Inc.
Version 6.2.1  for Linux 2.4.18 : 2003
Working data will be in /home/bs/pd/MySwork
[1] "testfile"
[1]+  Stopped                 Splus
turmalin:~/>cat testfile
"x" <-
"Johnson Partners LLC"

turmalin:~/>fg
Splus
[1]+  Stopped                 Splus
turmalin:~/>cat test2
## Dump S Version 4 Dump ##
x
character
character
1
Johnson Partners LLC


....
[2]+  Stopped                 Splus
turmalin:~/>cat dumpdata
x
character
1
Johnson Partners LLC


So what you have looks like the oldStyle (? - check line 1) data.dump()
format, which is quite different from dump().

data.restore() from the foreign package can read those if they contain
only basic data objects. For the oldStyle=F format, you seem to be out
of luck.

(And BTW, R will _parse_ almost any file consisting of lines with just a
single word or a numeric constant. That doesn't mean it can do
anything sensible with it...)