NVL {statnet.common}R Documentation

Convenience functions for handling NULL objects.

Description

Convenience functions for handling NULL objects.

Usage

NVL(...)

NVL(x) <- value

Arguments

...

Expressions to be tested.

x

an object to be overwritten if NULL.

value

new value for x.

Functions

See Also

NULL, is.null, if

Examples


a <- NULL

print(a) # NULL
print(NVL(a,0)) # 0

b <- 1

print(b) # 1
print(NVL(b,0)) # 1

# Also,
print(NVL(NULL,1,0)) # 1
print(NVL(NULL,0,1)) # 0
print(NVL(NULL,NULL,0)) # 0
print(NVL(NULL,NULL,NULL)) # NULL

NVL(a) <- 2
a # 2
NVL(b) <- 2
b # still 1

[Package statnet.common version 4.0.0 Index]