slice_data function

Slice data with user-specified expression