Generating variable names for dataframes based on the loop number in a loop in R

前端 未结 2 1144
执念已碎
执念已碎 2021-01-29 02:32

I am working on developing and optimizing a linear model using the lm() function and subsequently the step() function for optimization. I have added a variable to my dataframe b

2条回答
  •  旧巷少年郎
    2021-01-29 03:00

    Don't create objects with numbers in their names, and then try and access them in a loop later, using get and paste and assign. The right way to do this is to store your elements in an R list object.

提交回复
热议问题