I received the error
Error in if (condition) { : argument is of length zero
or
Error in while (condition) { : argument is
See ?NULL
You have to use is.null
‘is.null’ returns ‘TRUE’ if its argument is ‘NULL’ and ‘FALSE’ otherwise.
Try this:
if ( is.null(hic.data[[z]]) ) { print("is null")}
From section 2.1.6 of the R Language Definition
There is a special object called NULL. It is used whenever there is a need to indicate or specify that an object is absent. It should not be confused with a vector or list of zero length. The NULL object has no type and no modifiable properties. There is only one NULL object in R, to which all instances refer. To test for NULL use is.null. You cannot set attributes on NULL.