anadiedrichs / frost

R package frost: prediction of minimum temperature for frost forecasting in agriculture
Other
5 stars 0 forks source link

fix dewpoint method #66

Closed anadiedrichs closed 5 years ago

anadiedrichs commented 5 years ago

`

library(frost) dewpoint <- calcDewPoint(training.set$junin.humedad_med,training.set$junin.temp_med,mode = "B") Warning message: In if (RH < 50) { : the condition has length > 1 and only the first element will be used `

anadiedrichs commented 5 years ago

The reason I receive this warning is when RH is a vector but I'm comparing it with a scalar. R automatically takes the first element of the vector.

anadiedrichs commented 5 years ago

A reproducible example

source('~/phd-repos/tmin/frost/R/dewPoint.R') RH <- rnorm(100, mean = 50,sd=10) temperature <- rnorm(100,mean = 10,sd=5) out <- calcDewPoint.B(RH, temperature)

shows this warning:

Warning message: In if (RH < 50) { : the condition has length > 1 and only the first element will be used