I want to store different output variables that are calculated inside a function. I coded a toy example:
f = function(number)
{
xx = NULL
savexx = NULL
savexx10 = NULL
for (i in 1:10) {
x = number*i
xx = c(xx,x)
}
save_phrase = "hello"
savexx = xx
savexx10 = xx*10
save = cbind(savexx,savexx10)
}
store = f(1)
store
But with this code it is returning only the variable save = cbind(savexx,savexx10)
.
I would like to save all the 4 variables that are created inside this function.
Is it possible doing this without using a dataframe or a list?