Re: [R] Reading S-plus data in R

2017-02-27 Thread Martin Maechler
> Richard M Heiberger > on Sun, 26 Feb 2017 15:46:07 -0500 writes: > Bill, > this looks good. Can you add it to the splus2R package? Well, the natural place would rather be the foreign package, and some of use R core members would be happy with maintaining a function with

Re: [R] Reading S-plus data in R

2017-02-27 Thread roslinazairimah zakaria
Hi William, I read again your message. Yes, finally, it works beautifully! Thank you so much. ## Import Data from S-Plus to R library(foreign) data.restore4("C:/Users/FTSI/Desktop/2 ICGPA/1ACTIVITY.sdd", verbose=TRUE, print=TRUE, env = SplusDataEnv <- new.env()) objects(SplusDataEnv) dt <- Splu

Re: [R] Reading S-plus data in R

2017-02-27 Thread roslinazairimah zakaria
Hi Willianm, Thank you. However, still null: > library(foreign) > dt <- data.restore4("C:/Users/FTSI/Desktop/2 ICGPA/1ACTIVITY.sdd", verbose=TRUE, print=TRUE, env = SplusDataEnv <- new.env()) > SplusDataEnv[["dt"]] NULL On Mon, Feb 27, 2017 at 10:41 AM, William Dunlap wrote: > > It stores t

Re: [R] Reading S-plus data in R

2017-02-26 Thread William Dunlap via R-help
> It stores the objects it reads from the file 'file' in the environment 'env'. > > data.restore4 <- function(file, print = FALSE, verbose = FALSE, env = .GlobalEnv) It returns NULL. foreign::data.restore() returns the 'file' argument and I should have copied that behavior (even though it is not

Re: [R] Reading S-plus data in R

2017-02-26 Thread roslinazairimah zakaria
Hi all, Something is working but the data is NULL. I tried this: library(foreign) > dt <- data.restore4("C:/Users/FTSI/Desktop/2 ICGPA/1ACTIVITY.sdd") > head(dt); tail(dt) NULL NULL On Mon, Feb 27, 2017 at 12:57 AM, William Dunlap wrote: > You should be looking for foreign::data.restore, not

Re: [R] Reading S-plus data in R

2017-02-26 Thread Richard M. Heiberger
Bill, this looks good. Can you add it to the splus2R package? Rich On Sun, Feb 26, 2017 at 11:57 AM, William Dunlap via R-help wrote: > You should be looking for foreign::data.restore, not data.dump nor read.S. > > In any case, I think that foreign::data.restore does not recognize S-version4

Re: [R] Reading S-plus data in R

2017-02-26 Thread William Dunlap via R-help
You should be looking for foreign::data.restore, not data.dump nor read.S. In any case, I think that foreign::data.restore does not recognize S-version4 data.dump files, ones whose first line is ## Dump S Version 4 Dump ## Here is a quickly written and barely tested function that should read dat

Re: [R] Reading S-plus data in R

2017-02-26 Thread roslinazairimah zakaria
Hi Michael, Yes, I did tried and still got error: > library(foreign) > data.dump(oldStyle=TRUE) Error in eval(expr, envir, enclos) : could not find function "data.dump" > source(.trPaths[5], echo=TRUE, max.deparse.length=150) > read.S(file.path("C:/Users/FTSI/Desktop/2 ICGPA/1ACTIVITY.sdd")) E

Re: [R] Reading S-plus data in R

2017-02-26 Thread Michael Dewey
Did you do library(foreign) first? On 26/02/2017 07:23, roslinazairimah zakaria wrote: Hi William, Thank you so much for your reply. However, I still got error message: data.dump(oldStyle=TRUE) Error: could not find function "data.dump" data.restore("C:/Users/FTSI/Desktop/2 ICGPA/1ACTIVITY

Re: [R] Reading S-plus data in R

2017-02-25 Thread roslinazairimah zakaria
Hi William, Thank you so much for your reply. However, I still got error message: > data.dump(oldStyle=TRUE) Error: could not find function "data.dump" > data.restore("C:/Users/FTSI/Desktop/2 ICGPA/1ACTIVITY.sdd") Error: could not find function "data.restore" Thank you. On Sun, Feb 26, 2017

Re: [R] Reading S-plus data in R

2017-02-25 Thread William Dunlap via R-help
The sdd file extension may mean that the file is in S+ 'data dump' format, made by S+'s data.dump function and readable in S+ by its data.restore function. foreign::data.restore can read some such files in R, but I think it may only read well those with using the pre-1991 format made in more recent

Re: [R] Reading S-plus data in R

2017-02-24 Thread Roslina Zakaria
It should be .sdd Sent from my Sony Xperia™ smartphone Bert Gunter wrote >I see ".ssd" in your message and ".sdd" in your read.S () invocation... > >-- Bert >Bert Gunter > >"The trouble with having an open mind is that people keep coming along >and sticking things into it." >-- Opus (a

Re: [R] Reading S-plus data in R

2017-02-24 Thread Bert Gunter
I see ".ssd" in your message and ".sdd" in your read.S () invocation... -- Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Fri, Feb 24, 2017 at 8:58 PM, ro