lets say you have a list (in vector form, or a set or something) of N vectors and you want to concatenate all of them. However the vectors might have various lengths and types.

An efficient way to do this would be to find the length of the new vector first and allocate an empty version.

```
x = [rand(rand(1:5) for i in 1:10]
newvec = Vector{Float64}(sum(length(ix) for ix in x)))
... fill it in
```

But if you don’t know the types, what do you do? I was thinking of using `reduce`

.

```
newvec = reduce(append!, x)
```

However I am guessing there is a better way. Is there?

For context, I am trying to work on DataFramesMeta’s `transform(g::GroupedDataFrame, ...)`

function.

```
using DataFramesMeta
df = DataFrame(a = [1, 1, 2, 2], b = [4,5, missing, missing])
df2 = @linq df |>
groupby(df, :a) |>
transform(t = a - mean(a))
```

This will throw an error, because DataFramesMeta first allocates an empty array with the type of the first returned vector, for the first group. So it will create `Vector{Float64}`

and throw an error when missings are added.

However I think this question applies more generally to a number contexts.