**OutLie..R**, and kindly contributed to R-bloggers)

The histogram for distance shows a similar pattern, where with the railroad it was a nice log looking distribution, this is a little more even. The second histogram is a zoomed in and the bins expanded for greater detail.

While the map is not as great as the railroad, which is why the distance histogram is so important, it does show a good representation of the northwestern states. Unlike the railroad map, each line does represent more participants than 3.

What makes this tool so great is the ability to visually show the interaction between distance, number of participants, and the draw of an event. The numbers are nothing really new, but the charts are what make this analysis shine. When talking to community representatives whose education range from high school graduate to PhD, pictures are critical.

`#Soldier Hallow Analysis`

soho<-read.csv(file.choose(), header=TRUE)

summary(soho)

table.city<-sort(table(soho$city), decreasing=TRUE)

table.st<-sort(table(soho$state), decreasing=TRUE)

par(mar=c(5, 11, 4, 2), las=2)

barplot(table.city, main=‘SoHo: Cities’, horiz=TRUE, col=‘red’)

par(mar=c(5, 4, 4, 2), las=2)

barplot(table.st, main=‘SoHo: States’, horiz=TRUE, col=‘red’)

heber<-c(-111.33259, 40.511413)

soho.data<-matrix(data=c(soho$long, soho$lat), nrow=373, ncol=2)

soho.ut<-subset(soho, subset=(state==‘UT’))

soho.data.ut<-matrix(data=c(soho.ut$long, soho.ut$lat), nrow=29, ncol=2)

soho.dist<-(distm(heber, soho.data, fun=distVincentyEllipsoid)*0.000621371192)

soho.dist.ut<-(distm(heber, soho.data.ut, fun=distVincentyEllipsoid)*0.000621371192)

dist.soho<-matrix(soho.dist, nrow=373, ncol=1)

dist.soho.ut<-matrix(soho.dist.ut, nrow=29, ncol=1)

summary(dist.soho)

sd(dist.soho)

p.skew.soho<-(3*(mean(dist.soho)-median(dist.soho)))/sd(dist.soho)

hist(dist.soho, main=‘SoHo: Distance Histogram’, col=‘red’)

hist(dist.soho.ut, main=‘SoHo: Distance Histogram Utah’, breaks=20, col=‘red’)

#mapping it out

#US

map("state", col="#f2f2f2", fill=TRUE, bg="white", lwd=0.25)

title(main=‘SoHo: US Map’)

for(i in 1:dim(soho.data)[1]){

inter <- gcIntermediate(heber, soho.data[i, 1:2], n=373, addStartEnd=TRUE)

lines(inter, col="red")

}

#Zoomed into West

par(mfrow=c(1,2), mar=c(5,4,4,2))

map("state", col="#f2f2f2", fill=TRUE, bg="white", lwd=0.25, xlim=c(-125, -103), ylim=c(30, 50))

title(main=‘SoHo: Western Region’)

for(i in 1:dim(soho.data)[1]){

inter <- gcIntermediate(heber, soho.data[i, 1:2], n=373, addStartEnd=TRUE)

lines(inter, col="red")

}

#Utah

map("state", col="#f2f2f2", fill=TRUE, bg="white", lwd=0.25, xlim=c(-112.1, -111), ylim=c(40, 42))

title(main=‘SoHo: Utah’)

for(i in 1:dim(soho.data.ut)[1]){

inter <- gcIntermediate(heber, soho.data.ut[i, 1:2], n=29, addStartEnd=TRUE)

lines(inter, col="red")

}

par(mfrow=c(1,1))

Created by Pretty R at inside-R.org

**leave a comment**for the author, please follow the link and comment on their blog:

**OutLie..R**.

R-bloggers.com offers

**daily e-mail updates**about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...