na_if_empty | R Documentation |
This is a helper function in defence against empty list items from iDAI.field 2 / Field Desktop, which sometimes occur. It simply writes NA in the corresponding field if a list or any kind of object handed to it is of length 0. Otherwise, it returns the input untouched.
na_if_empty(item)
item |
any object whatsoever |
NA if empty, or the object that has been handed to it
## Not run:
na_if_empty(1)
na_if_empty(list(2,3,4,list(4,5,4)))
na_if_empty(NULL)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.