@@ -11,11 +11,11 @@ and behaves like them in most situations.
11
11
12
12
## Propagation of Missing Values
13
13
14
- The behavior of ` missing ` values follows one basic rule: ` missing `
15
- values * propagate * automatically when passed to standard operators and functions,
16
- in particular mathematical functions. Uncertainty about the value of one of the operands
17
- induces uncertainty about the result. In practice, this means an operation involving
18
- a ` missing ` value generally returns ` missing `
14
+ ` missing ` values * propagate * automatically when passed to standard mathematical
15
+ operators and functions.
16
+ For these functions, uncertainty about the value of one of the operands
17
+ induces uncertainty about the result. In practice, this means a math operation
18
+ involving a ` missing ` value generally returns ` missing `
19
19
``` jldoctest
20
20
julia> missing + 1
21
21
missing
@@ -31,12 +31,17 @@ As `missing` is a normal Julia object, this propagation rule only works
31
31
for functions which have opted in to implement this behavior. This can be
32
32
achieved either via a specific method defined for arguments of type ` Missing ` ,
33
33
or simply by accepting arguments of this type, and passing them to functions
34
- which propagate them (like standard operators). Packages should consider
34
+ which propagate them (like standard math operators). Packages should consider
35
35
whether it makes sense to propagate missing values when defining new functions,
36
36
and define methods appropriately if that is the case. Passing a ` missing ` value
37
37
to a function for which no method accepting arguments of type ` Missing ` is defined
38
38
throws a [ ` MethodError ` ] ( @ref ) , just like for any other type.
39
39
40
+ Functions that do not propagate ` missing ` values can be made to do so by wrapping
41
+ them in the ` passmissing ` function provided by the
42
+ [ Missings.jl] ( https://github.com/JuliaData/Missings.jl ) package.
43
+ For example, ` f(x) ` becomes ` passmissing(f)(x) ` .
44
+
40
45
## Equality and Comparison Operators
41
46
42
47
Standard equality and comparison operators follow the propagation rule presented
0 commit comments