void9: tests the nullness of objects

Description Usage Arguments Details Value Future Examples

View source: R/rbsa0.code.r

Description

Returns TRUE is the structure is empty.
This function was proposed because the NULL cannot replace any kind of objects.
Notice that void9("") is TRUE.

Usage

1
2

Arguments

x

object to be scrutinazed

vector

This argument is considered only when x is a character or a (numeric or logical). When FALSE it is considered void when all components are "" or NA; when TRUE, a vector with same length as x is returned indicating which components are "" or NA.

Details

Non-existing objects are not detected as void! Functions are considered as not void. Mainly NULL, NA and length-zero object are void then a data.frame with at least one variable is declared as not void. Character "" is considered as void.

Value

TRUE when the object is considered as void FALSE if not. Can also be a vector for characters when vector. See the proposed examples.

Future

Find a trick for non-existing objects: difficulty of the kind is that TRUE is detected as void and more

Examples

1
2
3
4
5
6
7
 
  ## Not run: void9(toto); 
  void9(numeric(0)); 
  void9(NULL); 
  void9(""); 
  void9(c("","A")); 
  void9(c("","A"),vector=TRUE); 

rbsa documentation built on May 2, 2019, 6:07 p.m.