Skip to content

Commit

Permalink
Update README.
Browse files Browse the repository at this point in the history
  • Loading branch information
markrogoyski committed Jun 14, 2023
1 parent 06b4959 commit 1319094
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ Quick Reference
| [`filterKeys`](#Filter-Keys-1) | Filter for keys where predicate function is true | `$stream->filterKeys($predicate)` |
| [`flatMap`](#Flat-Map-1) | Map function onto elements and flatten result | `$stream->flatMap($function)` |
| [`flatten`](#Flatten-1) | Flatten multidimensional stream | `$stream->flatten($dimensions)` |
| [`frequencies`](#Frequencies-1) | Frequency distribution | `$stream->frequencies([$strict])` |
| [`groupBy`](#Group-By-1) | Group iterable source by a common data element | `$stream->groupBy($groupKeyFunction, [$itemKeyFunc])` |
| [`infiniteCycle`](#Infinite-Cycle) | Cycle through the elements of iterable source sequentially forever | `$stream->infiniteCycle()` |
| [`intersectionWith`](#Intersection-With) | Intersect iterable source and given iterables | `$stream->intersectionWith(...$iterables)` |
Expand All @@ -220,6 +221,7 @@ Quick Reference
| [`partialIntersectionWith`](#Partial-Intersection-With) | Partially intersect iterable source and given iterables | `$stream->partialIntersectionWith( $minIntersectionCount, ...$iterables)` |
| [`partialIntersection CoerciveWith`](#Partial-Intersection-Coercive-With) | Partially intersect iterable source and given iterables with type coercion | `$stream->partialIntersectionCoerciveWith( $minIntersectionCount, ...$iterables)` |
| [`reindex`](#Reindex-1) | Reindex keys of key-value stream | `$stream->reindex($reindexer)` |
| [`relativeFrequencies`](#Relative-Frequencies-1) | Relative frequency distribution | `$stream->relativeFrequencies([$strict])` |
| [`reverse`](#Reverse-1) | Reverse elements of the stream | `$stream->reverse()` |
| [`runningAverage`](#Running-Average-1) | Accumulate the running average (mean) over iterable source | `$stream->runningAverage($initialValue)` |
| [`runningDifference`](#Running-Difference-1) | Accumulate the running difference over iterable source | `$stream->runningDifference($initialValue)` |
Expand Down Expand Up @@ -2613,6 +2615,21 @@ $result = Stream::of($data)
// [1, 2, 3, 4, 5]
```

#### Frequencies
Frequency distribution of the stream elements.

```$stream->frequencies(bool $strict = true): Stream```

```php
$grades = ['A', 'A', 'B', 'B', 'B', 'C'];

$result = Stream::of($grades)
->frequencies()
->toAssociativeArray();

// ['A' => 2, 'B' => 3, 'C' => 1]
```

#### Group By
Return a stream grouping by a common data element.

Expand Down Expand Up @@ -2824,6 +2841,21 @@ $reindexResult = Stream::of($data)
// ]
```

#### Relative Frequencies
Relative frequency distribution of the stream elements.

```$stream->relativeFrequencies(bool $strict = true): Stream```

```php
$grades = ['A', 'A', 'B', 'B', 'B', 'C'];

$result = Stream::of($grades)
->relativeFrequencies()
->toAssociativeArray();

// A => 0.33, B => 0.5, C => 0.166
```

#### Reverse
Reverse the elements of a stream.

Expand Down

0 comments on commit 1319094

Please sign in to comment.