Uploading the the needed datasets from GitHub. Performing analysis on the data
library(ggplot2)
library(RColorBrewer)
library(ggthemes)
## Warning: package 'ggthemes' was built under R version 3.2.2
#load all data, sort and subset top 5
oldbird <- read.csv("https://raw.githubusercontent.com/dbouquin/Pigeons/master/OldBirds.csv")
youngbird <- read.csv("https://raw.githubusercontent.com/dbouquin/Pigeons/master/American_Racing_Pigeon_Union_Young_Bird_Data.csv")
fastanimal <- read.csv("https://raw.githubusercontent.com/dbouquin/Pigeons/master/fast_animals.csv")
#barplot(summary (oldbird$YPM))
op <- par(mar=c(12,4,4,2))
barplot((table(oldbird$Regions)), las =2, col = 'skyblue', main="Number of Pigeons by Regions")
oldbird2<-subset(oldbird, oldbird$POS == 1 )
oldbird2 <- oldbird2[with(oldbird2, order(-YPM)),]
oldbird3 <- oldbird2[1:5,]
#plot(oldbird2$YPM)
youngbird2 <- youngbird[with(youngbird, order(-YPM)),]
fastanimal2 <- fastanimal[with(fastanimal, order(-max_speed_ym)),]
fastanimal3 <-fastanimal2[1:6,]
fastanimal3$animal <- factor(fastanimal3$animal)
youngbird3 <- youngbird2 [1:5,]
Using ggplot2, RColorBrewer, and ggthemes, we created graphs to represent the fastest racing pigeons and fastest animals.
#Plot all three charts
ggplot(data = youngbird3, aes(x =youngbird3$NAME , y = youngbird3$YPM))+geom_point(aes(color=YPM, size =4))+ scale_fill_brewer(palette = "Accent") + geom_text(aes(label = round(YPM)), hjust = -0.5, vjust = -0.5, size = 3)+ylab("Speed in Yard / Minutes") +xlab ("Owners ") + theme(axis.text.x = element_text(angle=15, vjust=.6, hjust=.6, size = 14))+ggtitle("FASTEST YOUNG PIGEONS")+expand_limits(y = 1580) + scale_y_continuous(expand = c(0,5))
ggplot(data = oldbird3, aes(x =oldbird3$NAME , y = oldbird3$YPM))+geom_point(aes(color=YPM, size =4))+scale_fill_brewer(palette = "Accent") +geom_text(aes(label = round(YPM)), hjust = 0.5, vjust = -0.5, size = 3)+ylab("Speed in Yard / Minutes") +xlab ("Owners") + theme(axis.text.x = element_text(angle=15, vjust=.6, hjust=.6, size = 14))+ggtitle("FASTEST OLD PIGEONS")
ggplot(data = fastanimal3, aes(x = fastanimal3$animal, y = fastanimal3$max_speed_ym))+geom_point()+scale_fill_brewer(palette = "Accent")+geom_text(aes(label = round( max_speed_ym)), hjust = 0.5, vjust = -0.5, size = 3) +ylab("Speed in Yard / Minutes") + xlab (" ") + theme(axis.text.x = element_text(angle=90, vjust=0.8, hjust=.8, size = 14)) +ggtitle("FASTEST ANIMALS' SPEED")+geom_point(aes(color=animal, size =4))+expand_limits(y = 2000) + scale_y_continuous(expand = c(0,2000))
We uploaded the data from GitHub and tidy and transformed the data to perform analysis. We wanted to see what was the distance flown by the racing pigeons compared average (medal winning) historical bird distance.
library(dplyr)
## Warning: package 'dplyr' was built under R version 3.2.2
##
## Attaching package: 'dplyr'
##
## The following objects are masked from 'package:stats':
##
## filter, lag
##
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(knitr)
YB1_url <- read.csv(file="https://raw.githubusercontent.com/dbouquin/Pigeons/master/American_Racing_Pigeon_Union_Young_Bird_Data.csv", header=TRUE, sep=",")
OB_url <- read.csv(file="https://raw.githubusercontent.com/dbouquin/Pigeons/master/OldBirds.csv", header=TRUE, sep=",")
War_url <- read.csv(file="https://raw.githubusercontent.com/dbouquin/Pigeons/master/Dickin_Medal_Pigeons.csv", header=TRUE, sep=",")
head(YB1_url, 3)
## ORGANIZATION LOCATION YEAR POS NAME BAND NUMBER CLR X
## 1 75 Combine Glenpool, OK 2015 1 KEN ROBINSO/5 915 AU 15 GTO BB C
## 2 75 Combine Glenpool, OK 2015 2 KEN ROBINSON 916 AU 15 GTO BB C
## 3 75 Combine Glenpool, OK 2015 3 NATHAN /5 15458 AU 15 LEGU BBPD H
## ARRIVAL MILES TOWIN YPM WS.Std.Pts NDB.Std.Pts
## 1 10:38:20 117.233 0 1303.133 9 95
## 2 10:38:29 2/5 0.08 1301.900 4 91
## 3 10:35:59 114.084 1.54 1287.131 99 86
head(OB_url, 3)
## Year Regions POS NAME BAND_NU MB ER numbers CLR X
## 1 2013 75 Combines 1 LARRY MITCH/5 132 AU 12 OKM BB C
## 2 2014 Wichita Friendly 1 CCC&SON /3 1659 AU 10 WFPF BC C
## 3 2014 Wichita Friendly 2 CCC 2 /3 3308 AU 12 WFPF SLT C
## ARRIVAL MILES TOWIN YPM WS_Std_Pts NDB_Std_Pts
## 1 9:53:03 135.89 0 2115.579 126 96
## 2 8:48:15 93.223 0 2096.765 50 92
## 3 8:48:16 93.223 0 2096.319 49 83
YB1_table <- data.frame(YB1_url[c(1, 5, 11, 13)])
YB1_table$TYPE <- "YOUNG BIRD (RACING PIGEONS)"
OB1_table <- data.frame(OB_url[c(2, 4, 12, 14)])
colnames(OB1_table)[1] <- "ORGANIZATION"
OB1_table$TYPE <- "OLD BIRD (RACING PIGEONS)"
Bird_table <- rbind.data.frame(YB1_table, OB1_table)
Bird_table$MILES <- as.numeric(format(Bird_table$MILES))
## Warning: NAs introduced by coercion
mile_tb <- subset(Bird_table, MILES > 1)
head(mile_tb)
## ORGANIZATION NAME MILES YPM TYPE
## 1 75 Combine KEN ROBINSO/5 117.233 1303.133 YOUNG BIRD (RACING PIGEONS)
## 3 75 Combine NATHAN /5 114.084 1287.131 YOUNG BIRD (RACING PIGEONS)
## 5 75 Combine R & M LOFT /5 114.084 1286.773 YOUNG BIRD (RACING PIGEONS)
## 10 75 Combine DILLARD LOF/5 130.847 1284.146 YOUNG BIRD (RACING PIGEONS)
## 11 75 Combine Wegge Wings/5 130.794 1283.030 YOUNG BIRD (RACING PIGEONS)
## 12 75 Combine Larry Mitch/5 98.152 1282.934 YOUNG BIRD (RACING PIGEONS)
mile_tb_total <- mile_tb %>% group_by(TYPE, ORGANIZATION) %>% summarise(AVERAGE_MILES = mean(MILES)) %>% data.frame()
mile_tb_total$ORGANIZATION[mile_tb_total$ORGANIZATION == "Wichita Friendly"] <- "Wichita Friendly Pigeon Flyers"
mile_tb_total$ORGANIZATION[mile_tb_total$ORGANIZATION == "Dallas"] <- "Dallas Homing RPC"
mile_tb_total$ORGANIZATION[mile_tb_total$ORGANIZATION == "Evergreen State"] <- "Evergreen State Concourse"
mile_tb_total$ORGANIZATION[mile_tb_total$ORGANIZATION == "75 Combines"] <- "75 Combine"
Medal_tb <- subset(War_url, Distance.mi. > 1)
Medal_tb_total <- Medal_tb %>% summarise(AVERAGE_MILES = mean(Distance.mi.)) %>% data.frame()
head(Medal_tb)
## X Recipiant Animal Date_of_award Distance.mi. Time.hr.min.
## 1 1 White Vision Pigeon 2-Dec-43 60
## 2 2 Winkie Pigeon 2-Dec-43 120
## 3 3 Tyke Pigeon 2-Dec-43 100
## 5 6 Gustav Pigeon 1-Sep-44 150 5.16
## 6 7 Paddy Pigeon 1-Sep-44 230 4.50
## 10 16 Dutch Coast Pigeon Mar-45 288 7.30
## Time.min.
## 1 NA
## 2 NA
## 3 NA
## 5 316
## 6 290
## 10 450
## Link
## 1 https://en.wikipedia.org/wiki/White_Vision
## 2 https://en.wikipedia.org/wiki/Winkie_(pigeon)
## 3 http://www.christies.com/LotFinder/lot_details.aspx?intObjectID=1854977
## 5
## 6
## 10
## Comments
## 1 With the plane's radio out of action, and bad weather conditions were preventing it from being found by other planes she was released and flew some 60 miles against a strong headwind, arriving back at her pigeon loft. The search was resumed and the plane was subsequently found,B with all eleven members of the air crew saved after they had spent some eighteen hours in the sea.
## 2 Using the time difference from the plane ditching to the arrival of the pigeon in the loft, and taking into account the wind direction and the inhibition to her flight speed caused by oil spoilage to her feathers, theB RAFB were able to approximate where the plane ditched. Within 15 minutes the crewBs position had been located and a rescue vessel dispatched.
## 3 B in visibility which was never better than two miles, he delivered a message on behalf of an endangered American Aircrew, the latter claiming on their subsequent rescue that the gallant "Tyke" had saved their lives.
## 5 Gustav traveled the 150 miles (240B km) to his loft atB RAF Thorney IslandB in five hours and sixteen minutes, while facing aB headwindB of up to 30B mph (48B km/h),B where his handler Sgt Harry Halsey received him.B Gustav's message was the first word of the invasion to reach the British mainland, due to the fleet undergoing radio silence at the time.
## 6 B He flew 230 miles across theB English ChannelB in four hours and fifty minutes, the fastest recorded crossing.
## 10 In April 1942, the bomber on which it was on board was ditched in the water near the Dutch coast. The bird was the only one on-board and was retrieved by the crew who released it from the dinghy at 6:20am.
TYPE <- "WAR PIGEONS"
ORGANIZATION <- "Dickin Medal Winners"
vec1 <- data.frame(TYPE, ORGANIZATION, Medal_tb_total)
Final_Bird_table <- rbind.data.frame(mile_tb_total, vec1)
Final_Bird_table$AVERAGE_MILES <- round(Final_Bird_table$AVERAGE_MILES, 1)
Using ggplot2, knitr, and ggthemes, we created graph and table to compare the average distance flown by racing pigeons and Dickin medal winning pigeons.
kable(Final_Bird_table, align = "c", caption = "Average distance flown by racing pigeons today, compared to historical pigeons distance(medal winning).")
| TYPE | ORGANIZATION | AVERAGE_MILES |
|---|---|---|
| OLD BIRD (RACING PIGEONS) | Apple Valley RPC | 98.7 |
| OLD BIRD (RACING PIGEONS) | 75 Combine | 148.9 |
| OLD BIRD (RACING PIGEONS) | Dallas Homing RPC | 132.9 |
| OLD BIRD (RACING PIGEONS) | Evergreen State Concourse | 138.6 |
| OLD BIRD (RACING PIGEONS) | Wichita Friendly Pigeon Flyers | 107.8 |
| YOUNG BIRD (RACING PIGEONS) | 75 Combine | 126.4 |
| YOUNG BIRD (RACING PIGEONS) | Apple Valley RPC | 96.6 |
| YOUNG BIRD (RACING PIGEONS) | Dallas Homing RPC | 138.4 |
| YOUNG BIRD (RACING PIGEONS) | Evergreen State Concourse | 127.1 |
| YOUNG BIRD (RACING PIGEONS) | Wichita Friendly Pigeon Flyers | 102.9 |
| WAR PIGEONS | Dickin Medal Winners | 212.2 |
ggplot(data = Final_Bird_table, aes(x=ORGANIZATION, y = AVERAGE_MILES, fill=TYPE)) + scale_colour_tableau() + theme_solarized(light=FALSE) + theme(legend.position="top") + geom_bar(stat="identity", position = "dodge") + theme(axis.text.x = element_text(angle=10, vjust=.9, hjust=.6)) + ggtitle(" Average distance flown by racing pigeons today, \ncompared to historical (medal winning) pigeons' distance.") + ylab("AVERAGE DISTANCE TRAVELED (MILES)")