What is the best way to avoid passing a data frame around?

前端 未结 3 1360
南旧
南旧 2021-01-04 10:05

I have 12 data.frames to work with. They are similar and I have to do the same processing to each one, so I wrote a function that takes a data.frame

3条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-04 10:48

    I came across this question looking for something else, and it's old - so I'll just provide a brief answer for now (leave a comment if you'd like more explanation).

    You can pass around environments in R which contain anywhere from 1 to all of your variables. But probably you don't need to worry about it.

    [You might also be able to do something similar with classes. I only currently understand how to use classes for polymorphic functions - and note there's more than 1 class system kicking around.]

提交回复
热议问题