How would one break apart a UnitRange? From this example I’d like to create a Vector or Array that has 1,2,3,4,5,6 etc. in it, instead of 1:2, 3:4, 5:6
Thank you for your reply. collect() does not break apart the Vector{UnitRange{Int64}}. What I am using it for is more complicated - I have a DataFrame where I sort by 0, then take every 4th element in the Vector{UnitRange{Int64}}. I’d like to be able to ‘explode’ or break apart those sorted elements.
I’m just writing this to encourage you to simplify your questions more, by creating a minimal example. In particular, not everyone has DataFrames, and cannot understand your question without installing it. (In fact, you just put some data into a DataFrame and then read it directly back.)
What I mean is, I do not want the middle values between each UnitRange. For example, if I have 1:252, 1225:1475, 2303:2555, 3342:3594, 4383:4652 in my UnitRange, I would like to break it apart into 1,252,1225,1475,2303 etc.
That’s clever! I didn’t realize that would work. But I wonder if it’s more idiomatic to use the function, ‘flatten’, rather than the (undocumented) constructor ‘Flatten’.