budyko_sim: Simulate Budyko Curve

View source: R/functions.R

budyko_simR Documentation

Simulate Budyko Curve

Description

Simulate Budyko Curve

Usage

budyko_sim(
  p = 2,
  fit = NULL,
  method = "budyko",
  res = 0.01,
  hshift = FALSE,
  hs = NULL,
  silent = FALSE
)

Arguments

p

numeric parameter value for custom Budyko curve

fit

list dataframe object with names() method and entries "param" for parameter p, "err" for vertical fit error, and "hshift" for optional hshift value (default to zero)

method

A string. One of the following: Fu, Turc-Pike, Wang-Tank

res

numeric resolution of fit, defaults to 0.01 units

hshift

A boolean. T/F (default F), whether to test for horizontal shift

hs

numeric optional horizontal shift value

silent

A boolean. (default F) display error message?

Value

Given a Budyko Curve type and fit parameter, simulates a smooth curve in Budyko-space

Examples

library(ggplot2)
fit=as.data.frame(c("param"=2,"err"=0.5,"hshift"=0))
blankBC+
    geom_line(data=budyko_sim(fit=fit,method="Fu"))+
    coord_cartesian(xlim=c(0,5))+
    theme_bw()

tylerbhampton/budykoR documentation built on April 21, 2024, 4:39 a.m.