def reorder! order
      raise ArgumentError, 'Invalid order specified' unless
        order.sort == size.times.to_a
      # TODO: Room for optimization
      old_data = to_a
      new_data = order.map { |i| old_data[i] }
      initialize_core_attributes new_data
      self
    end
Reorder the vector with given positions
@note Unlike #reindex! which takes index as input, it takes
positions as an input to reorder the vector
@param [Array] order the order to reorder the vector with
@return reordered vector
@example
dv = Daru::Vector.new [3, 2, 1], index: ['c', 'b', 'a'], type: :category
dv.reorder! [2, 1, 0]
# => #<Daru::Vector(3)>
#   a   1
#   b   2
#   c   3