Nothing
#' Difference calculator
#'
#' Calculates difference between values of random meal plan created and targets logged.
#' @param val Value to be evalueted.
#' @param min Minimum constraint.
#' @param max Maximum constraint.
#' @return Difference.
#' @export
diff_calc <- function(val, min, max){
res <- ifelse((val < min),
{val - min},
ifelse((val > max),
{val - max},
0))
return(res)
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.