Description Usage Arguments Details
Calculate healthiness Score
1 2 | healthScore(df_res, df_tot = df_res, score, normalise = c("Ncati",
"Nall"), method = c("simple", "expFun", "threshold"), threshold = 2)
|
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") |
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.