NULL
From base v3.3
by R-core R-core@R-project.org
The Null Object
NULL
represents the null object in R: it is a reserved
word. NULL
is often returned by expressions and functions
whose value is undefined.
as.null
ignores its argument and returns the value NULL
.
is.null
returns TRUE
if its argument
is NULL
and FALSE
otherwise.
Usage
NULL
as.null(x, ...)
is.null(x)
Arguments
- x
- an object to be tested or coerced.
- ...
- ignored.
Details
NULL
can be indexed (see Extract) in just about any
syntactically legal way: whether is makes sense or not, the result is
always NULL
. Objects with value NULL
can be changed by
replacement operators and will be coerced to the type of the
right-hand side.
NULL
is also used as the empty pairlist.
Note
is.null
is a primitive function.
References
Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) The New S Language. Wadsworth & Brooks/Cole.
Examples
library(base)
is.null(list()) # FALSE (on purpose!)
is.null(integer(0)) # FALSE
is.null(logical(0)) # FALSE
as.null(list(a = 1, b = "c"))
Community examples
Looks like there are no examples yet.