healthScore: Calculate healthiness Score

Description Usage Arguments Details

View source: R/healthScore.R

Description

Calculate healthiness Score

Usage

1
2
healthScore(df_res, df_tot = df_res, score, normalise = c("Ncati",
  "Nall"), method = c("simple", "expFun", "threshold"), threshold = 2)

Arguments

df_res

the dataframe of the restaurant environment(count within a buffer)

df_tot

dataframe of the restaurant environment for normalisation. By default same as the df_res

score

the healthiniess score

normalise

if normalise is Ncati, normalise by the number of restaurant categotris, e.g. if there are 3 fastfood and 5 cafe, the number of categories is 2. If the normalise is Nall, then normalise by the total number of resturant, in the previous example: 8.

method

method to calculate healthiness score, can be from c("simple", "expFun", <e2><80><9c>threshold")

Details

all the 0 restaurants records are NA. if method is "simple", healthScore = sum(NumberRestau \* score). The method "expFun" calculate healthiness score with an exponential function of the number of restaurants sum(log(numberOfrestaurant+1) \* score). The "threshold" method treats more than a certain number (i.e. threshold) restaurants as the certain number of resturants


mengluchu/food_envir documentation built on May 3, 2019, 1:34 p.m.