[S] source(For()) works (almost) in S-Plus v4.0

Steve Edland (edland@u.washington.edu)
Thu, 18 Jun 1998 14:27:32 -0700 (PDT)


For loops apparently don't work in S-Plus v4.0, Windows 95.

I have found that sourcing the output of a call to For(), e.g.,:

source(For(i=1:10,x[i]_foo()))

works just fine. The only problem is you have to exit S-plus and
get back in before you can continue. It seems that I am very close to a
complete work-around. Can anyone take it the next step? I would like
to be able to submit a batch file with multiple For loops.

Thanks,
Steve Edland
Alzheimer's Disease Research Center
University of Washington

(An earlier posting describing the problem is attached below. Joel
Damiani says that the problem has been fixed in v4.5. That doesn't
solve my immediate problem, since the University of Washington site
licence is for v4.0.)

---------- Forwarded message ----------
Date: Wed, 17 Jun 1998 16:04:57 -0700 (PDT)
From: Steve Edland <edland@u.washington.edu>
To: s-news <s-news@wubios.wustl.edu>
Subject: [S] For() under Windows

I am having trouble using For loops in Splus version 4.0 under windows
95.

1. using For() creates a source file, but does not run it.

2. using source(For()) runs the For loop, but after running this Splus
is no longer responsive -- no matter what I type I either get no
response or error messages.

An example follows.

Could someone please direct me to the appropriate documentation for
running a For loop under windows, or suggest a work-around.

Thanks in advance for any help,
Steve Edland
Alzheimer's Disease Research Center
University of Washington

EXAMPLE:

> x_rep(NA, 10)
> For(i=1:10,x[i]_i)
[1] "It5793A8.tmp"
> source(For(i=1:10,x[i]_i))
> 7-5
> x
> source(For(i=1:10,x[i]_i))
Warning messages:
".Steps" assigned on database 1 but hidden by an object of the same name on database 0 in: assign(".Steps", steps, w = 1,
immediate = T)
>
(try hitting <ESC> key:)
>
User interrupt requested
Error in parse(): Error returned by S_AXUM_getinput
Dumped
S_apiParseTest failure
>
> x
S_apiParseTest failure
> x
Warning: eval initialized twice
> x
S_apiParseTest failure
> x
Warning: eval initialized twice
>

-----------------------------------------------------------------------
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

-----------------------------------------------------------------------
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