get_val function

Get value from environmental variable or R option or default in that order if the previous one is missing.