Vectorize rH.to.VPD
Issue #1
resolved
There is an if
statement in the rH.to.VPD
function that is not vetorized :
rH.to.VPD <- function(rH,Tair){
if(rH > 1){
warning("relative humidity (rH) has to be between 0 and 1.")
}
...
It could be nice to vectorize it using any()
for people using the function in other context :
rH.to.VPD <- function(rH,Tair){
if(any(rH > 1)){
warning("relative humidity (rH) has to be between 0 and 1.")
}
...
Comments (5)
-
-
repo owner Thanks! I have just submitted the corrected version. Will be on CRAN with the next package update.
-
repo owner - changed status to resolved
corrected
-
Thank you very much !
-
repo owner I have changed this to:
if(any(rH > 1 & !is.na(rH))){ warning("relative humidity (rH) has to be between 0 and 1.") }
otherwise it will give an error if there are NAs
- Log in to comment
Sorry, it wasn't meant to be anonymous. I want to be kept informed about this issue.