allan miller
2005-Dec-29 19:31 UTC
[R] Problem Reading SPlus Dump Into R - Spaces Embedded in Data
Hello, I'm trying to source() an SPlus 6.x file created using dump(..., oldStyle=T) into R (version 2.01) as using the following instructions:> *If you have access to S-PLUS, it is usually more reliable to |dump| > the object(s) in S-PLUS and |source| the dumpfile in R. For S-PLUS 5.x > and 6.x you may need to use |dump(..., oldStyle=T)|, and to read in > very large objects it may be preferable to use the dumpfile as a batch > script rather than use the |source| function.*(from "R Data Import/Export," pg. 15) An example: > source("testdump") Error in parse(file, n, text, prompt) : syntax error on line 1895 where the data on line 1895 - and other lines causing this - have embedded spaces, such as the following: [line 1895] Johnson Partners LLC I can't seem to find any options for either the SPlus dump, or R source(), that relate to this problem. Any suggestions for how to either dump or source files containing data with embedded spaces? Thank You. [[alternative HTML version deleted]]
Peter Dalgaard
2005-Dec-29 21:00 UTC
[R] Problem Reading SPlus Dump Into R - Spaces Embedded in Data
allan miller <amiller at a2software.com> writes:> Hello, > > I'm trying to source() an SPlus 6.x file created using dump(..., > oldStyle=T) into R (version 2.01) as using the following instructions: > > > *If you have access to S-PLUS, it is usually more reliable to |dump| > > the object(s) in S-PLUS and |source| the dumpfile in R. For S-PLUS 5.x > > and 6.x you may need to use |dump(..., oldStyle=T)|, and to read in > > very large objects it may be preferable to use the dumpfile as a batch > > script rather than use the |source| function.* > > (from "R Data Import/Export," pg. 15) > > An example: > > > source("testdump") > Error in parse(file, n, text, prompt) : syntax error on line 1895 > > where the data on line 1895 - and other lines causing this - have > embedded spaces, such as the following: > > > [line 1895] Johnson Partners LLC > > > I can't seem to find any options for either the SPlus dump, or R > source(), that relate to this problem. Any suggestions for how to > either dump or source files containing data with embedded spaces?A bit more context might be helpful. What's in lines surrounding 1895? Can you show a simple S-PLUS object displaying the behaviour? What happens if you dput() the object? Will S-PLUS itself restore the file? -- O__ ---- Peter Dalgaard ??ster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
Reasonably Related Threads
- How to bring an Splus object into R
- [PATCH] - xc_core.c/xenctrl.h - refactor slightly to allow user specified output routines
- dumpfile with libshout2/icecast2
- [LIBNBD SECURITY PATCH 0/1] NBD Protocol Downgrade Attack in libnbd
- convert a splus randomforest object to R