Do you mean you want to limit only on the plot or you want to filter the data too, < 5000 miles?
adding +xlim(0, 5000) on your graph code above will limit the graph x-axis plot to 5000.
If you want to filter the data and run the graph code again,
library(tidyverse)
ArendasB%>% filter (distance< 5000)%>% ggplot((ArendasB%>% filter (distance< 5000), aes(x=city, y=distance)) + geom_boxplot()+
coord_flip()+labs(y="distance(miles)")+theme_bw()+
ggtitle("Figure 3: Estimated distance by city", labs
(caption= "Brandon Arendas - Section 002"))+scale_y_continuous(labels = function(y)
format(y, scientific = FALSE))