Problem 1

tx <- read.csv("tx.csv")

library(ggplot2)
library(trelliscopejs)
library(tidyverse)

tx <- mutate(tx, trip_duration_log = cog(val=log10(trip_duration), desc="Log Base 10 of Trip Duration"))

tx %>%
  filter(trip_duration < 63, trip_duration > 1) %>%
  ggplot( aes(x=trip_duration)) +
  geom_histogram() +
  
  facet_trelliscope(~ pick_day,
                    name = "Date",
                    desc = "Route Data from 7/01/2016 to 12/31/2016",
                    nrow = 2, ncol = 3,
                    path =".",
                    self_contained = TRUE)

The ‘tx’ data set contains information on taxi rides between 7/01/2016 and 12/31/2016. The data includes total cost amounts, tip amounts, payment types, trip durations, and the days of the week the taxi rides occurred. The variable that I am graphing is the trip duration to determine if there are any patterns between the trip duration and other variables in the data set. The reason for choosing to facet on the trip duration variable is to find trends with the taxi trip durations over the span of six months. By investigating this trend, I am attempting to find a pattern with which days had the longest trip durations between July and December and why this would occur.

Challenges that I had with making this graph include scaling the data to remove outliers and determining which cognostic measure to investigate. When analyzing the data, I first had to look at the quantiles to see which values fell into the 1st and 99th percentiles so that I could graph an accurate representation of the data. In order to determine which cognostic measure to investigate, I had to look at the data I was using and attempt to use several cognostics to see which was the most useful. The cognostic that I chose was to take the log10 of each trip duration. By taking the log of each trip duration, I was able to reduce the impact of outliers and simplify the measurements.