Fill NULL indices with a range from 1:dim

fill_missing_indices(index, dim)

Arguments

index

a numeric value or NULL

dim

size of dimension