[Rd] Using {} for NULL

Duncan Murdoch murdoch@dunc@n @end|ng |rom gm@||@com
Thu Apr 30 11:42:56 CEST 2026


The news item for a recent R-devel bug fix says this:

  - ‘cut(1:11, {})’ now signals an error for the invalid ‘breaks’, 
fixing PR#19057, thanks to Kevin Ushey.

When I read that, I wondered why {} was used.  Does it give some weird 
exotic object?  No, its value is NULL, which was used in the referenced 
bug report.

So my question is:  why use {} instead of NULL in an expression?  I 
don't think there are any efficiency advantages.

Duncan Murdoch



More information about the R-devel mailing list