R/erosivFUN.R

Defines functions erosivFUN

Documented in erosivFUN

erosivFUN = function(rain,A,B, model="linear") {
  total <- 20
  MFI=rain
  if(model=="linear"){erosivity=rain*B+A}
  else if(model=="Fourier"){erosivity=A*MFI^B}
  else if(model=="power"){erosivity=A*rain^B}
  else if(model=="logarithmic"){erosivity=B*log(rain)+A}
  else if(model=="exponential"){erosivity=A*exp(B*rain)}

  for(i in 1:20){
    Sys.sleep(0.1)
    setTxtProgressBar((txtProgressBar(min = 0, max = total, style = 3)), i)
  }
  return(erosivity)
}

Try the soilassessment package in your browser

Any scripts or data that you put into this service are public.

soilassessment documentation built on Aug. 31, 2020, 1:06 a.m.