Hello S users --
I have a dataframe named (DATA.FRAME) with 70 observations and 92
sets of 5 columns. The name for each column includes an ID number
(ID) to identify which set it belongs to.
I have written a function (PAIRWISE) to export scatterplots of the 10
pairwise combinations in each set. The function relies on this
primary element (repeated five times to name the five vectors):
NAME1 <- paste("ONE", ID, sep="")
VECTOR1 <- get(NAME1, where=DATA.FRAME)
...
NAME5 <- paste("FIVE", ID, sep="")
VECTOR5 <- get(NAME5, where=DATA.FRAME)
Then I use lapply(1:92, PAIRWISE) to run the whole shebang. The
function does what it's supposed to, but when the lapply is used it
will only process the first four values in the list before I get this error:
Error in get.default(NAME1, where = DATA.FRAME): Too many databases
in use, maximum is 50
However, I can run items 5:8 immediately after items 1:4 without
making any changes -- it's as if databases are accumulating in the
function, and clearing as soon as it breaks. Does anyone know how I
can avoid this error to run the script smoothly from 1:92? If this
isn't enough information I am happy to supply the whole script (it's
somewhat unweildly...).
Many thanks,
Sarah
|