data(Freiburg1)
# Distance matrix for grocery stores in Freiburg
data(Freiburg2)
# Statistical districts of Freiburg
groceryfr <- huff (Freiburg1, "district", "store", "salesarea", "distance", gamma=1, lambda=-2)
# Huff interaction matrix for given grocery stores in Freiburg
# with standard weighting (power function with gamma=1 and lambda=-2)
groceryfr_total <- huff (Freiburg1, "district", "store", "salesarea", "distance",
gamma=1, lambda=-2, localmarket_dataset = Freiburg2, origin_id = "district",
localmarket = "ppower", output="total")
# Calculating total sales of the stores
Run the code above in your browser using DataLab