16.2 If else statements
k_c <- function(temp_k) {
if (temp_k < 0) {
warning('you passed in a negative Kelvin number')
# stop()
return(NA)
} else {
temp_c <- temp_k - 273.15
return(temp_c)
}
}
Our current function does not deal with missing numbers