rStats.js v1.3.0
    Preparing search index...

    Function seq

    • Regular sequences. Equivalent to R's seq(). seq(from, to) steps by ±1; by steps by the increment, up to to; lengthOut gives that many values, both ends exact. from or to may be omitted (undefined) when the other two are given; seq(n) alone is 1, 2, ..., n.

      Parameters

      • Optionalfrom: number
      • Optionalto: number
      • options: SeqOptions = {}

      Returns number[]

      seq(0, 1, { by: 0.25 });     // [0, 0.25, 0.5, 0.75, 1]
      seq(0, 1, { lengthOut: 3 }); // [0, 0.5, 1]