Displaying 1 result from an estimated 1 matches for "storelatlon".
2004 Apr 04
1
How to improve this code?
..., append=TRUE,
sep=",",row.names=FALSE, col.names=FALSE)
#Trade Area Size
TAsize <- c(100)
custlatlon <- customerlist[, 2:3]
for(i in 1:length(TAsize)){
for(j in 1:nrow(storelist)){
cat("Store: ", storelist[j]," TA Size = ", TAsize[i],
"\n")
storelatlon <- storelist[j, 2:3]
whichval <-
which(rdist.earth(t(as.matrix(storelatlon)), as.matrix(custlatlon),
miles=F) <= TAsize[i])
dist <-
as.data.frame(rdist.earth(t(as.matrix(storelatlon)),
as.matrix(custlatlon), miles=F)[whichval])
storetag <-
as.data.frame(cbind(1:nrow(dist),...