# Load required packages
library(readxl)
library(plotly)
## Loading required package: ggplot2
## 
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## The following object is masked from 'package:stats':
## 
##     filter
## The following object is masked from 'package:graphics':
## 
##     layout
# Read data from Excel file
NERF <- read_xlsx("Nerf.xlsx",
                  col_types = c("date","guess",
                                "guess","guess",
                                "guess","numeric"))
names(NERF) <- c("Time","Blaster","Modified","DartType",
                 "DartNumber","Distance")
NERF$Blaster <- factor(NERF$Blaster)
NERF$Modified <- factor(NERF$Modified)
NERF$DartType <- factor(NERF$DartType)

# Create interactive box plot
interactive_boxplot <- plot_ly(data = NERF, 
                               x = ~DartType, 
                               y = ~Distance,
                               type = "box") %>%
  layout(title = "Dart Type vs. Distance Traveled",
         xaxis = list(title = "Dart Type"),
         yaxis = list(title = "Distance Traveled (in ft)"),
         boxmode = "group",
         showlegend = FALSE)

# Display the interactive box plot
interactive_boxplot
## Warning: 'layout' objects don't have these attributes: 'boxmode'
## Valid attributes include:
## '_deprecated', 'activeshape', 'annotations', 'autosize', 'autotypenumbers', 'calendar', 'clickmode', 'coloraxis', 'colorscale', 'colorway', 'computed', 'datarevision', 'dragmode', 'editrevision', 'editType', 'font', 'geo', 'grid', 'height', 'hidesources', 'hoverdistance', 'hoverlabel', 'hovermode', 'images', 'legend', 'mapbox', 'margin', 'meta', 'metasrc', 'modebar', 'newshape', 'paper_bgcolor', 'plot_bgcolor', 'polar', 'scene', 'selectdirection', 'selectionrevision', 'separators', 'shapes', 'showlegend', 'sliders', 'smith', 'spikedistance', 'template', 'ternary', 'title', 'transition', 'uirevision', 'uniformtext', 'updatemenus', 'width', 'xaxis', 'yaxis', 'barmode', 'bargap', 'mapType'