标签云

微信群

扫码加入我们

WeChat QR Code

Is it possible to set an options to NULL while using getOption with a default value other than NULL?options("TEST" = NULL)getOption("TEST")# NULLgetOption("TEST", default=1)# [1] 1I would have expected the last line to return NULL.Is this intended behavior.


You can see my comment on a deleted post, correct?Just wanted to make sure.

2019年05月22日41分53秒

richard Yes, I do. I appreciate the fact that you replied at all, by the way. :-)

2019年05月22日41分53秒

Oh, absolutely.I appreciate you commenting and giving me a chance to do something first, rather than just logging a downvote. I'm here to learn and (hopefully) help others at the same time.

2019年05月22日41分53秒

Thanks Konrad for the answer.This might be the best workaround, but I do hate littering my code with a slew of [[1]] -- although I'm not sure if there is any other way

2019年05月22日41分53秒

Ricardo Well you’d wrap it into a function, of course. Something like getNullableOption

2019年05月22日41分53秒