Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

thornthwaite() not working as in previous versions of the package #68

Open
VeruGHub opened this issue Jul 26, 2023 · 0 comments
Open

thornthwaite() not working as in previous versions of the package #68

VeruGHub opened this issue Jul 26, 2023 · 0 comments

Comments

@VeruGHub
Copy link

Hi,
Me and @prebollo are trying to calculate ETP for Castilla y León using thornthwaite(). I have noticed that the function is not working as before, since you cannot calculate ETP for just one temperature value. Maybe I am missing something but could you confirm if something is going wrong? Thanks! Here a reproduccible example:

library(SPEI)
#> # Package SPEI (1.8.1) loaded [try SPEINews()].

meantemp <- c(2.18, 12.19, 27.33)
lati <- 41.47

thornthwaite(Tave = meantemp, lat = lati) #Ok
#> [1] "Checking for missing values (`NA`): all the data must be complete. Input type is vector. Assuming the data are monthly time series starting in January, all regular (non-leap) years."
#> [1]  15.40596  59.55327 139.12358

thornthwaite(Tave = meantemp[1], lat = lati) #It worked before with just one temperature value
#> [1] "Checking for missing values (`NA`): all the data must be complete. Input type is vector. Assuming the data are monthly time series starting in January, all regular (non-leap) years."
#> Error in apply(Tt, c(2, 3), function(x) {: 'MARGIN' does not match dim(X)

Created on 2023-07-26 with reprex v2.0.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant