LE <- function(scores, layers){
# calculate LE scores
scores.LE = scores %>%
filter(goal %in% c('LIV','ECO') & dimension %in% c('status','trend','score','future')) %>%
spread(key = goal, value = score) %>%
mutate(score = rowMeans(cbind(ECO, LIV), na.rm=TRUE)) %>%
select(region_id, dimension, score) %>%
mutate(goal = 'LE')
# rbind to all scores
scores = scores %>%
rbind(scores.LE)
# return scores
return(scores)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.