R/S1.R

Defines functions S1

Documented in S1

#' healthiness score1
#' @param df_res the dataframe of the resturant environment(count within a buffer)
#' @param  score the healthiniess score
#' @details calculated as sum(score * foodenv_count)
#' @export
#'
S1 = function(df_res,  score)
{
  mul = sweep(df_res,2, score, "*")
  apply(mul,1,sum)
}
mengluchu/food_envir documentation built on May 3, 2019, 1:34 p.m.