Hi, I want to make a simple function with colnames x1, x2, …
So I made a below function and realized that “df” should be outside of the function.
Why the loop does not work if “df” is inside of the function?
I want to make a function including df inside.
Could someone help me?
Happy new year!
> function ASD(k::Int64)
> df=DataFrame()
> for i in 1:k
> @eval df.$(Symbol("x$i")) = randn(10)
> end
>
> return df
> end
a=ASD(2)