generate_temp: generate temperature

Description Usage Arguments Value Examples

View source: R/WGEN_temp.R

Description

generate temperature

Usage

1
generate_temp(wk_list, start_date = "1980-01-01", end_date = "2010-12-31")

Arguments

wk_list

list of weekly parameters from temp_wk_list() function

start_date

"yyy-mm-dd" string for start date of simulated temperature

end_date

"yyy-mm-dd" string for end date of simulated temperature

Value

dataframe, that includes simulated minimum and maximum temperature

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
wk_list <- temp_wk_list(wx_data)
test <- generate_temp(wk_list, "1980-01-01", "1982-12-31")
plot(test$Tmax_C, col = "red", type = "l")
lines(test$Tmin_C, col = "blue")
hist((test$Tmax_C-test$Tmin_C))
# testing
if (FALSE) {
test <- generate_temp(wk_list, "1980-01-01", "2079-12-31") # 30 sec to run
dplyr::summarize(test, Tmax_C = mean(Tmax_C), Tmin_C = mean(Tmin_C))
# compare to original data
dplyr::summarize(wx_data, Tmax_C = mean(Tmax_C), Tmin_C = mean(Tmin_C))
}

MartinHoldrege/precipr documentation built on Nov. 4, 2021, 11:10 a.m.