Skip to content
Prev 42795 / 398506 Next

A language technical question.

You have two problems.

1) You want to use

assign(paste("kalle", i, sep=""), saveLoadReference)

to create the name.

That one is discussed frequently enough to be an FAQ, and it is Q7.23.

2) You need to keep the return value of load to assign to the object.

So I think you want

for(i in length(infiles)) 
    assign(paste("kalle", i, sep=""), load(infiles[i]))

However, that assigns to kalle{n} the names(s) of the objects you loaded.
Is that what you actually wanted?  Or did you want the actual objects, not 
their `representation'.

If you want the actual objects, I suggest you use .readRDS instead.
On Thu, 15 Jan 2004, Johan Lindberg wrote: