TakeEvery / Manipulation Layer

Select rows at regular intervals (every nth row) starting from a specified position. Similar to pandas' df.iloc[start::n] or R's seq(start, nrow(df), by=n).

Example with start=0, n=2 (every 2nd row):

Original DataFrame:

IndexValue
0A
1B
2C
3D
4E
5F

After take_every(start=0, n=2):

IndexValue
0A
2C
4E

Common applications:

  • Data downsampling
  • Regular interval sampling
  • Time series decimation
  • Periodic snapshot analysis
  • Systematic observation selection
  • Load reduction
  • Pattern frequency analysis
  • Regular data thinning

Note: Selection pattern is deterministic and regular, useful for systematic sampling.

Table
0
0
Table

Starting position for selection (zero-based). Common patterns:

  • 0: Start from beginning (most common)
  • 1: Skip first row
  • n: Skip first n rows
  • -n: Start n rows from end Controls phase of selection pattern
0

Interval between selected rows. Common uses:

  • 2: Every other row (50% reduction)
  • 7: Weekly samples from daily data
  • 24: Daily samples from hourly data
  • 10: Decimal reduction
  • 100: Percentage point sampling