playdata3<-read.csv(tracklist2,header =T)
attach(playdata3)
library(dplyr)
library(ggplot2)
#velocity: calculated for each play using x-y coordinates
#acceleration : calculated for each play using x-y coordinates
#v_dirr : velocity direction angle for each play
#acc_dirr: acceleration direction angle for each play
#vdir_ch : velocity direction change for each play
#accdir_ch: acceleration direction change for each play
#aver_dir : direction change of player's motion for each play
#aver_orient : direction change of player's orientation for each play
#time : time duration for each play
#dis: distance for each play
stadfield<-ggplot(data = tracklist2) + 
  geom_bar(mapping = aes(x = StadiumType, fill = FieldType))
stadfield+coord_flip()+
  ggtitle("OUTDOOR STADIUM IS THE MAJOR TYPE WITH NATURAL SURFACE") 

ggplot(playdata3, aes(Weather, velocity)) + geom_boxplot(fill = "red")+
  scale_y_continuous("velocity", breaks= seq(0,10, by=1))+
  labs(title = "EFFECT OF WEATHER ON VELOCITY", x = "Weather")
