I create some objects using the following script:
for (i in 1:length(A.list))
for (j in 1:length(B.list))
assign(paste(A.list[i], ".foo.", B.list[j], ".bar", sep=""),
foobar(A.list[i], some.arg=B.list[j]))
[where A.list <- c("a1", "a2", ... , "ai"), B.list <- c("b1", "b2", ... ,
"bj"), and foobar() takes the corresponding character arguments]
and save the results to my disk using dump.data() in a similar construction.
The real A.list has length=12 and there are five possible B.lists, some with
length>=300, and the resulting objects may be 100kb in size.
Thus I want to remove each set of objects from my S+ database before
creating the next lot, using something like:
object.names <- vector(length=length(B.list))
for (i in 1:length(A.list))
for (j in 1:length(B.list)){
assign(object.names[j], paste(A.list[i], ".foo.",
B.list[j], ".bar", sep=""))
rm(list=object.names)
}
But this gives (for length(A.list)=length(B.list)=3) 18 copies of the
following message
Warning messages:
Warning in remove(list): "FALSE" to be removed not in database
> traceback()
Message: Error in parse(text = txt): Syntax error: Unbalanced parentheses,
expected ")", before "}" at this point:
script.run(exprs.literal={
object.names <- vector(length=length ...
[j], ".bar", sep="")); rm(list=object.names); }; }
}
1:
Considerable experimentation has so far merely produced a variety of results
for traceback().
I'd be very grateful if someone would point out my error, and if possible
supply a working solution.
Julian Wells
School of Management
The Open University
Walton Hall
Milton Keynes
MK7 6AA
United Kingdom
(01908) 654658
+44 (1908) 654658
|