R/Plant_Growth.R

#' Plant Growth
#' 
#' This function calculates plant growth for an imaginary plant that grows only when sunshine hours for a certain timeframe is bigger than one.
#' 
#' @param Sun.  A dataframe, multidimensional array, or other input that contains sunshine hours.  The default is sunshine_hours, a multidimensional array with sunshine hours by months and years for three different locations.
#' @author Cristina
#' @example plant_growth(sun = sunshine_hours)
#' @return The plant growth of an imaginary plant based on hours of sunshine.  Assume this growth is in mm.

plant_growth = function(sun = sunshine_hours) {

  growth = ifelse (sun > 1, sun^2 + 3, 0)
  return(growth)

}
raefuhrman/262_Final_Package documentation built on June 15, 2019, 2:44 p.m.