## Research question 

How does the type of hit in baseball games (e.g., Fly, Ground, Line) relate to the exit velocity of the ball and the predicted zone where the ball is expected to land?

### Cases 

There are 906 cases, each representing a specific hit in various baseball matchups. 

### Data collection 

The information about this dataset was taken from the site fivethirtyeight(https://data.fivethirtyeight.com/)

### Type of study 

**The documentation suggests that this is an observational study. **

### Data Source 

**https://github.com/fivethirtyeight/data/tree/master/foul-balls**


### Dependent Variable

**The dependent variables are:
Exit Velocity and Predicted Zone:**

### Independent Variable(s)

The Independent Variable is: Type of Hit:


### Relevant summary statistics 
# Load necessary libraries
library(ggplot2)
library(readr)
 

url <- "https://raw.githubusercontent.com/fivethirtyeight/data/master/foul-balls/foul-balls.csv"

baseball_data <- read.csv(url)

head(data)
##                                                                             
## 1 function (..., list = character(), package = NULL, lib.loc = NULL,        
## 2     verbose = getOption("verbose"), envir = .GlobalEnv, overwrite = TRUE) 
## 3 {                                                                         
## 4     fileExt <- function(x) {                                              
## 5         db <- grepl("\\\\.[^.]+\\\\.(gz|bz2|xz)$", x)                     
## 6         ans <- sub(".*\\\\.", "", x)
ggplot(baseball_data, aes(x = type_of_hit, y = exit_velocity, fill = type_of_hit)) +
  geom_boxplot() +
  labs(
    title = "Exit Velocity by Type of Hit",
    x = "Type of Hit",
    y = "Exit Velocity"
  ) +
  theme_minimal()
## Warning: Removed 326 rows containing non-finite values (`stat_boxplot()`).