Relative Content

Tag Archive for rlazy-evaluationevaluation

Saving objects as part of a for-loop but passing object name into loop as a string

I spent the weekend enjoying my leisure time while my computer assiduously ran a series of 31 bayesian models in R (using the brms package. I assigned each of these model objects a name. So when I returned this morning I had 31 model objects in my workspace. Sadly, what I did not do on Friday afternoon was write code to save each of these model objects. It will take a LONG time to rerun the models a fair bit of code to save each of them. So I was wondering if it was possible to save the model objects by passing their name through a for-loop. Simple example included below