You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-10Lines changed: 7 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,15 +7,16 @@ The package is registered in the [`General`](https://github.com/JuliaRegistries/
7
7
8
8
## Introduction
9
9
GroupedArray is an AbstractArray that contains positive integers or missing values.
10
+
-`GroupedArray(x::AbstractArray)` returns a `GroupedArray` of the same length as the original array, where each distinct value is encoded as a distinct integer.
11
+
-`GroupedArray(xs...::AbstractArray)` returns a `GroupedArray` where each distinct combination of values is encoded as a distinct integer
12
+
- By default (with `coalesce = false`), `GroupedArray` encodes `missing` values as a distinct `missing` category. With `coalesce = true`, missing values are treated similarly to other values.
10
13
11
-
-`GroupedArray(x::AbstractArray)` returns a `GroupedArray` of the same length as the original array, where each distinct value is encoded by a distinct integer.
12
-
-`GroupedArray(xs...::AbstractArray)` returns a `GroupedArray` where each distinct combination of values is encoded by a distinct integer
13
-
- By default, `GroupedArray` groups all `missing` values into a distinct `missing` category. With `coalesce = true`, missing values are not treated differently.
14
+
## Examples
14
15
15
16
```julia
16
17
using GroupedArrays
17
18
p =repeat(["a", "b", missing], outer =2)
18
-
g =GroupedArray(p)
19
+
GroupedArray(p)
19
20
# 6-element GroupedArray{Int64, 1}:
20
21
# 1
21
22
# 2
@@ -24,21 +25,17 @@ GroupedArray is an AbstractArray that contains positive integers or missing valu
24
25
# 2
25
26
# missing
26
27
p =repeat(["a", "b", missing], outer =2)
27
-
g =GroupedArray(p; coalesce =true)
28
+
GroupedArray(p; coalesce =true)
28
29
# 6-element GroupedArray{Int64, 1}:
29
30
# 1
30
31
# 2
31
32
# 3
32
33
# 1
33
34
# 2
34
35
# 3
35
-
```
36
-
37
-
-`GroupedArray(xs::AbstractArray...)` combine groups defined by multiple vectors:
0 commit comments