0

How can I test from within R, without compiling custom C code, if an externalptr object is a null pointer? The best I can come up with is:

identical(capture.output(print(myptr)), "<pointer: 0x0>")

But that is kind of lame. I can do it in C, but I want to do it in R so that the user doesn't need a compiler.

Jeroen Ooms
  • 31,998
  • 35
  • 134
  • 207
  • 1
    i assume this doesn't quite do what you want http://stackoverflow.com/questions/26666614/how-do-i-check-if-an-externalptr-is-null-from-within-r ? – sckott Dec 07 '14 at 07:24
  • Well that is the C solution indeed. I would like something that doesn't require compiling custom C code. – Jeroen Ooms Dec 07 '14 at 20:34

0 Answers0