Apply common function to all data frames and return data frames with same name

前端 未结 2 393
醉酒成梦
醉酒成梦 2021-01-15 04:34

I\'m trying to apply a function to all similarly spelled data frames in my global environment in R. I want to apply this function to all these data frames, but I can\'t fig

2条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-15 04:55

    You can use eapply to iterate over an environment and then assign to store an object to your global environment. The function argument to eapply will be an anonymous function which first gets the df from global, assigning it to a temp variable, pass it to your function and then use assign to put it back to global.

    I'd show you the code, but if you can't code this yourself you really shouldn't be doing it.

提交回复
热议问题