missing_value: Return an empty symbol.

Description Usage Arguments Value See Also Examples

Description

The empty symbol (that is, the symbol whose string representation is "" is used to represent missing values in the R language; for instance in the value of formal function arguments when there is no default; in the expression slot of a promise when a missing argument is given; and bound to the value of a variable when it is called with a missing value. When computing on the language, then, you may need to explicitly invoke the "missing" value.

Usage

1

Arguments

n

Optional; a number. If provided, will return a list of missing values with this many elements.

Value

A symbol with empty name, or a list of such.

See Also

list_missing dots_missing

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# These statements are equivalent:
quote(function(x, y=1) x+y)
call("function", pairlist(x=missing_value(), y=1), quote(x+y))

# These statements are also equivalent:
quote(df[,1])
substitute(df[row,col], list(row = missing_value(), col = 1))

# These statements are also equivalent:
quote(function(a, b, c, d, e) print("hello"))
call("function", as.pairlist(put(missing_value(5), names, letters[1:5])),
                 quote(print("hello")))

crowding/vadr documentation built on May 14, 2019, 11:33 a.m.