[6450] in s-news-athena

home help back first fref pref prev next nref lref last post

Evaluating paramemters inside an expression

daemon@ATHENA.MIT.EDU (Ottar N. Bjornstad)
Wed Feb 15 13:44:51 1995

Date: Wed, 15 Feb 1995 13:11:34 +0100
To: s-news@utstat.toronto.edu
From: bjornsto@ERE.UMontreal.CA (Ottar N. Bjornstad)

I frequently find myself wanting to do tings like:

for(i in 1:10){
obji_some.odd.function()
}

And after something along the lines of:

for(i in 1:10){
write(obji,File="c:/filei.txt")
}

Some parts of this i manage.  But in general, S-plus does not evaluate the
expression all the places i want it to...For instance, it will always creat
a file of the name "filei.txt" rather than file1, file2, ..., file10.

In SAS it is easy,... you just write &i at the approriate places.  What is
the analogous expression in S+?


I am sorry, I am sure this is a FAQ, but I have not manage to find the
answer on my own.... Sorry?

Ottar
--------------------------------------------
Ottar N. Bjornstad
Until 10th of may 1995:
bjornsto@ere.umontreal.ca
Univ. Montreal., Dept. Sci. Biol., CP 6128, Montreal, H3C 3J7, Canada.
Tel. (514) 343 6111 ext 1233, Fax. (514) 343-2293

After:
ottarnb@bio.uio.no
Div. Zool., Dept. Biol., Univ. of Oslo, Box 1050 Blindern, 0316 Oslo, Norway
Tel. + 47 22857295, Fax. + 47 22854605




home help back first fref pref prev next nref lref last post