I have a DataFrame (df) whose columns are titled col1, col2, 0, 1, 2, 3, 4 and 5.
I need to create a vector referencing the first row (1) of columns 0, 1, 2, 3, 4 and 5.
The following code works, but isn’t dynamic.
vector = Array(df[1, 3:8])
I changed the titles to yr0, yr2 etc., and changed the code to the below, but get "MethodError: no method matching -(::String, ::String)
vector = Array(df[1, "yr0":"yr1"])
Is there a way to pull in a vector/array that’s dynamic and based on the title of the column vs. index reference? I’m new to Julia and coding, but thank you for your help!