Quantcast
Channel: How to check if object (variable) is defined in R? - Stack Overflow
Viewing all articles
Browse latest Browse all 8

Answer by tim for How to check if object (variable) is defined in R?

$
0
0

if you are inside a function, missing() is what you want.

exchequer = function(x) {    if(missing(x)){        message("x is missing… :-(")    }}exchequer()x is missing… :-(

Viewing all articles
Browse latest Browse all 8

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>