1
0

Initial commit

p#	new file:   runwikiq.sh
This commit is contained in:
2018-06-02 15:32:19 -07:00
commit 72633c193b
202 changed files with 21929 additions and 0 deletions

17
RCommunityData/R/hhi.R Normal file
View File

@@ -0,0 +1,17 @@
# Community Data Science Collective R Utilities
#
# Copyright (c) 2010-2016 Benjamin Mako Hill and Aaron Shaw
# mako@atdot.cc, aaronshaw@northwestern.edu
## functions to create normal and non-normalized herfenidahl indexes
hhi <- function (x) {
x <- x / sum(x)
sum(x**2)
}
hhi.norm <- function (x) {
n <- length(x)
h <- hhi(x)
(h - 1/n)/(1-1/n)
}