Note: on data sets

You may use any data of your choosing in the following problems, but I would suggest you choose a data set you find interesting or would give an interesting graph (so, don’t use something like the old iris data set). You will get more out of the project in the end, and it will look better to those in the future you are showing it to. If the data set comes from an R package then reference this. If the data set is from elsewhere, then upload a copy to blackboard (.csv format).


Problem 1 [20 points]

Create a plotly graph of your choosing that represents at least two variables, one of which must be a categorical variable.

This plot can be a scatter plot, overlayed density plots (graphing variable is continuous, separate densities grouped by categorical variable), etc. choropleth maps could also be on the list…you have to admit they look kinda cool.

The graph must include:

  1. customized hover text that is informative to the graphing elements in the plot

  2. separate color to represent groups

  3. labeled axes and appropriate title

Include at least a 1-paragraph discussion about the graph. Discuss what is being plotted and what information is being displayed in the graph. Discuss any information that the reader may gain from hovering the cursor over graphing elements. Discuss any issues/chalenges you had (if any) while making the plot, and you you dealt with or overcame them.

#Load Data Set

sleep <- read.csv("C:/Users/kimbr/Masters Program/STAT 5110/Week 5/Homework/Problem 1/Sleep_health_and_lifestyle.csv", 
                     header = TRUE)
#View(sleep)


sleep %>%
  plot_ly(x = ~Sleep.Duration , 
          y = ~Physical.Activity.Level, 
          color = ~Occupation,
          symbol = ~Occupation,
          hoverinfo = "text",
          text = ~paste("Daily Steps:", Daily.Steps,
                        "<br>Heart Rate:", Heart.Rate,
                        "<br>Blood Pressure:", Blood.Pressure,
                        "<br>BMI Category:", BMI.Category
                        )) %>%
  add_markers(
    marker = list(
      size = 10),
    colors = "Dark2") %>%
  
  
  layout(
  xaxis = list(title = "Daily Sleep Duration",
               color = toRGB("darkmagenta")),
  yaxis = list(title = "Physical Activity Level",
               color = toRGB("darkmagenta")),
  title = list(text = "Sleep Duration vs Physical Activity, by Occupation",
               font = list(
                 color = "chocolate",
                 size = 20),
               x = 0.15, y = 0.975))
## Warning: The shape palette can deal with a maximum of 6 discrete values because more
## than 6 becomes difficult to discriminate
## ℹ you have requested 11 values. Consider specifying shapes manually if you need
##   that many of them.
## Warning: The following are not valid symbol codes:
## 'NA'
## Valid symbols include:
## '0', '0', 'circle', '100', '100', 'circle-open', '200', '200', 'circle-dot', '300', '300', 'circle-open-dot', '1', '1', 'square', '101', '101', 'square-open', '201', '201', 'square-dot', '301', '301', 'square-open-dot', '2', '2', 'diamond', '102', '102', 'diamond-open', '202', '202', 'diamond-dot', '302', '302', 'diamond-open-dot', '3', '3', 'cross', '103', '103', 'cross-open', '203', '203', 'cross-dot', '303', '303', 'cross-open-dot', '4', '4', 'x', '104', '104', 'x-open', '204', '204', 'x-dot', '304', '304', 'x-open-dot', '5', '5', 'triangle-up', '105', '105', 'triangle-up-open', '205', '205', 'triangle-up-dot', '305', '305', 'triangle-up-open-dot', '6', '6', 'triangle-down', '106', '106', 'triangle-down-open', '206', '206', 'triangle-down-dot', '306', '306', 'triangle-down-open-dot', '7', '7', 'triangle-left', '107', '107', 'triangle-left-open', '207', '207', 'triangle-left-dot', '307', '307', 'triangle-left-open-dot', '8', '8', 'triangle-right', '108', '108', 'triangle-right-open', '208', '208', 'triangle-right-dot', '308', '308', 'triangle-right-open-dot', '9', '9', 'triangle-ne', '109', '109', 'triangle-ne-open', '209', '209', 'triangle-ne-dot', '309', '309', 'triangle-ne-open-dot', '10', '10', 'triangle-se', '110', '110', 'triangle-se-open', '210', '210', 'triangle-se-dot', '310', '310', 'triangle-se-open-dot', '11', '11', 'triangle-sw', '111', '111', 'triangle-sw-open', '211', '211', 'triangle-sw-dot', '311', '311', 'triangle-sw-open-dot', '12', '12', 'triangle-nw', '112', '112', 'triangle-nw-open', '212', '212', 'triangle-nw-dot', '312', '312', 'triangle-nw-open-dot', '13', '13', 'pentagon', '113', '113', 'pentagon-open', '213', '213', 'pentagon-dot', '313', '313', 'pentagon-open-dot', '14', '14', 'hexagon', '114', '114', 'hexagon-open', '214', '214', 'hexagon-dot', '314', '314', 'hexagon-open-dot', '15', '15', 'hexagon2', '115', '115', 'hexagon2-open', '215', '215', 'hexagon2-dot', '315', '315', 'hexagon2-open-dot', '16', '16', 'octagon', '116', '116', 'octagon-open', '216', '216', 'octagon-dot', '316', '316', 'octagon-open-dot', '17', '17', 'star', '117', '117', 'star-open', '217', '217', 'star-dot', '317', '317', 'star-open-dot', '18', '18', 'hexagram', '118', '118', 'hexagram-open', '218', '218', 'hexagram-dot', '318', '318', 'hexagram-open-dot', '19', '19', 'star-triangle-up', '119', '119', 'star-triangle-up-open', '219', '219', 'star-triangle-up-dot', '319', '319', 'star-triangle-up-open-dot', '20', '20', 'star-triangle-down', '120', '120', 'star-triangle-down-open', '220', '220', 'star-triangle-down-dot', '320', '320', 'star-triangle-down-open-dot', '21', '21', 'star-square', '121', '121', 'star-square-open', '221', '221', 'star-square-dot', '321', '321', 'star-square-open-dot', '22', '22', 'star-diamond', '122', '122', 'star-diamond-open', '222', '222', 'star-diamond-dot', '322', '322', 'star-diamond-open-dot', '23', '23', 'diamond-tall', '123', '123', 'diamond-tall-open', '223', '223', 'diamond-tall-dot', '323', '323', 'diamond-tall-open-dot', '24', '24', 'diamond-wide', '124', '124', 'diamond-wide-open', '224', '224', 'diamond-wide-dot', '324', '324', 'diamond-wide-open-dot', '25', '25', 'hourglass', '125', '125', 'hourglass-open', '26', '26', 'bowtie', '126', '126', 'bowtie-open', '27', '27', 'circle-cross', '127', '127', 'circle-cross-open', '28', '28', 'circle-x', '128', '128', 'circle-x-open', '29', '29', 'square-cross', '129', '129', 'square-cross-open', '30', '30', 'square-x', '130', '130', 'square-x-open', '31', '31', 'diamond-cross', '131', '131', 'diamond-cross-open', '32', '32', 'diamond-x', '132', '132', 'diamond-x-open', '33', '33', 'cross-thin', '133', '133', 'cross-thin-open', '34', '34', 'x-thin', '134', '134', 'x-thin-open', '35', '35', 'asterisk', '135', '135', 'asterisk-open', '36', '36', 'hash', '136', '136', 'hash-open', '236', '236', 'hash-dot', '336', '336', 'hash-open-dot', '37', '37', 'y-up', '137', '137', 'y-up-open', '38', '38', 'y-down', '138', '138', 'y-down-open', '39', '39', 'y-left', '139', '139', 'y-left-open', '40', '40', 'y-right', '140', '140', 'y-right-open', '41', '41', 'line-ew', '141', '141', 'line-ew-open', '42', '42', 'line-ns', '142', '142', 'line-ns-open', '43', '43', 'line-ne', '143', '143', 'line-ne-open', '44', '44', 'line-nw', '144', '144', 'line-nw-open', '45', '45', 'arrow-up', '145', '145', 'arrow-up-open', '46', '46', 'arrow-down', '146', '146', 'arrow-down-open', '47', '47', 'arrow-left', '147', '147', 'arrow-left-open', '48', '48', 'arrow-right', '148', '148', 'arrow-right-open', '49', '49', 'arrow-bar-up', '149', '149', 'arrow-bar-up-open', '50', '50', 'arrow-bar-down', '150', '150', 'arrow-bar-down-open', '51', '51', 'arrow-bar-left', '151', '151', 'arrow-bar-left-open', '52', '52', 'arrow-bar-right', '152', '152', 'arrow-bar-right-open', '53', '53', 'arrow', '153', '153', 'arrow-open', '54', '54', 'arrow-wide', '154', '154', 'arrow-wide-open
## Warning: The following are not valid symbol codes:
## 'NA'
## Valid symbols include:
## '0', '0', 'circle', '100', '100', 'circle-open', '200', '200', 'circle-dot', '300', '300', 'circle-open-dot', '1', '1', 'square', '101', '101', 'square-open', '201', '201', 'square-dot', '301', '301', 'square-open-dot', '2', '2', 'diamond', '102', '102', 'diamond-open', '202', '202', 'diamond-dot', '302', '302', 'diamond-open-dot', '3', '3', 'cross', '103', '103', 'cross-open', '203', '203', 'cross-dot', '303', '303', 'cross-open-dot', '4', '4', 'x', '104', '104', 'x-open', '204', '204', 'x-dot', '304', '304', 'x-open-dot', '5', '5', 'triangle-up', '105', '105', 'triangle-up-open', '205', '205', 'triangle-up-dot', '305', '305', 'triangle-up-open-dot', '6', '6', 'triangle-down', '106', '106', 'triangle-down-open', '206', '206', 'triangle-down-dot', '306', '306', 'triangle-down-open-dot', '7', '7', 'triangle-left', '107', '107', 'triangle-left-open', '207', '207', 'triangle-left-dot', '307', '307', 'triangle-left-open-dot', '8', '8', 'triangle-right', '108', '108', 'triangle-right-open', '208', '208', 'triangle-right-dot', '308', '308', 'triangle-right-open-dot', '9', '9', 'triangle-ne', '109', '109', 'triangle-ne-open', '209', '209', 'triangle-ne-dot', '309', '309', 'triangle-ne-open-dot', '10', '10', 'triangle-se', '110', '110', 'triangle-se-open', '210', '210', 'triangle-se-dot', '310', '310', 'triangle-se-open-dot', '11', '11', 'triangle-sw', '111', '111', 'triangle-sw-open', '211', '211', 'triangle-sw-dot', '311', '311', 'triangle-sw-open-dot', '12', '12', 'triangle-nw', '112', '112', 'triangle-nw-open', '212', '212', 'triangle-nw-dot', '312', '312', 'triangle-nw-open-dot', '13', '13', 'pentagon', '113', '113', 'pentagon-open', '213', '213', 'pentagon-dot', '313', '313', 'pentagon-open-dot', '14', '14', 'hexagon', '114', '114', 'hexagon-open', '214', '214', 'hexagon-dot', '314', '314', 'hexagon-open-dot', '15', '15', 'hexagon2', '115', '115', 'hexagon2-open', '215', '215', 'hexagon2-dot', '315', '315', 'hexagon2-open-dot', '16', '16', 'octagon', '116', '116', 'octagon-open', '216', '216', 'octagon-dot', '316', '316', 'octagon-open-dot', '17', '17', 'star', '117', '117', 'star-open', '217', '217', 'star-dot', '317', '317', 'star-open-dot', '18', '18', 'hexagram', '118', '118', 'hexagram-open', '218', '218', 'hexagram-dot', '318', '318', 'hexagram-open-dot', '19', '19', 'star-triangle-up', '119', '119', 'star-triangle-up-open', '219', '219', 'star-triangle-up-dot', '319', '319', 'star-triangle-up-open-dot', '20', '20', 'star-triangle-down', '120', '120', 'star-triangle-down-open', '220', '220', 'star-triangle-down-dot', '320', '320', 'star-triangle-down-open-dot', '21', '21', 'star-square', '121', '121', 'star-square-open', '221', '221', 'star-square-dot', '321', '321', 'star-square-open-dot', '22', '22', 'star-diamond', '122', '122', 'star-diamond-open', '222', '222', 'star-diamond-dot', '322', '322', 'star-diamond-open-dot', '23', '23', 'diamond-tall', '123', '123', 'diamond-tall-open', '223', '223', 'diamond-tall-dot', '323', '323', 'diamond-tall-open-dot', '24', '24', 'diamond-wide', '124', '124', 'diamond-wide-open', '224', '224', 'diamond-wide-dot', '324', '324', 'diamond-wide-open-dot', '25', '25', 'hourglass', '125', '125', 'hourglass-open', '26', '26', 'bowtie', '126', '126', 'bowtie-open', '27', '27', 'circle-cross', '127', '127', 'circle-cross-open', '28', '28', 'circle-x', '128', '128', 'circle-x-open', '29', '29', 'square-cross', '129', '129', 'square-cross-open', '30', '30', 'square-x', '130', '130', 'square-x-open', '31', '31', 'diamond-cross', '131', '131', 'diamond-cross-open', '32', '32', 'diamond-x', '132', '132', 'diamond-x-open', '33', '33', 'cross-thin', '133', '133', 'cross-thin-open', '34', '34', 'x-thin', '134', '134', 'x-thin-open', '35', '35', 'asterisk', '135', '135', 'asterisk-open', '36', '36', 'hash', '136', '136', 'hash-open', '236', '236', 'hash-dot', '336', '336', 'hash-open-dot', '37', '37', 'y-up', '137', '137', 'y-up-open', '38', '38', 'y-down', '138', '138', 'y-down-open', '39', '39', 'y-left', '139', '139', 'y-left-open', '40', '40', 'y-right', '140', '140', 'y-right-open', '41', '41', 'line-ew', '141', '141', 'line-ew-open', '42', '42', 'line-ns', '142', '142', 'line-ns-open', '43', '43', 'line-ne', '143', '143', 'line-ne-open', '44', '44', 'line-nw', '144', '144', 'line-nw-open', '45', '45', 'arrow-up', '145', '145', 'arrow-up-open', '46', '46', 'arrow-down', '146', '146', 'arrow-down-open', '47', '47', 'arrow-left', '147', '147', 'arrow-left-open', '48', '48', 'arrow-right', '148', '148', 'arrow-right-open', '49', '49', 'arrow-bar-up', '149', '149', 'arrow-bar-up-open', '50', '50', 'arrow-bar-down', '150', '150', 'arrow-bar-down-open', '51', '51', 'arrow-bar-left', '151', '151', 'arrow-bar-left-open', '52', '52', 'arrow-bar-right', '152', '152', 'arrow-bar-right-open', '53', '53', 'arrow', '153', '153', 'arrow-open', '54', '54', 'arrow-wide', '154', '154', 'arrow-wide-open
## Warning: The following are not valid symbol codes:
## 'NA'
## Valid symbols include:
## '0', '0', 'circle', '100', '100', 'circle-open', '200', '200', 'circle-dot', '300', '300', 'circle-open-dot', '1', '1', 'square', '101', '101', 'square-open', '201', '201', 'square-dot', '301', '301', 'square-open-dot', '2', '2', 'diamond', '102', '102', 'diamond-open', '202', '202', 'diamond-dot', '302', '302', 'diamond-open-dot', '3', '3', 'cross', '103', '103', 'cross-open', '203', '203', 'cross-dot', '303', '303', 'cross-open-dot', '4', '4', 'x', '104', '104', 'x-open', '204', '204', 'x-dot', '304', '304', 'x-open-dot', '5', '5', 'triangle-up', '105', '105', 'triangle-up-open', '205', '205', 'triangle-up-dot', '305', '305', 'triangle-up-open-dot', '6', '6', 'triangle-down', '106', '106', 'triangle-down-open', '206', '206', 'triangle-down-dot', '306', '306', 'triangle-down-open-dot', '7', '7', 'triangle-left', '107', '107', 'triangle-left-open', '207', '207', 'triangle-left-dot', '307', '307', 'triangle-left-open-dot', '8', '8', 'triangle-right', '108', '108', 'triangle-right-open', '208', '208', 'triangle-right-dot', '308', '308', 'triangle-right-open-dot', '9', '9', 'triangle-ne', '109', '109', 'triangle-ne-open', '209', '209', 'triangle-ne-dot', '309', '309', 'triangle-ne-open-dot', '10', '10', 'triangle-se', '110', '110', 'triangle-se-open', '210', '210', 'triangle-se-dot', '310', '310', 'triangle-se-open-dot', '11', '11', 'triangle-sw', '111', '111', 'triangle-sw-open', '211', '211', 'triangle-sw-dot', '311', '311', 'triangle-sw-open-dot', '12', '12', 'triangle-nw', '112', '112', 'triangle-nw-open', '212', '212', 'triangle-nw-dot', '312', '312', 'triangle-nw-open-dot', '13', '13', 'pentagon', '113', '113', 'pentagon-open', '213', '213', 'pentagon-dot', '313', '313', 'pentagon-open-dot', '14', '14', 'hexagon', '114', '114', 'hexagon-open', '214', '214', 'hexagon-dot', '314', '314', 'hexagon-open-dot', '15', '15', 'hexagon2', '115', '115', 'hexagon2-open', '215', '215', 'hexagon2-dot', '315', '315', 'hexagon2-open-dot', '16', '16', 'octagon', '116', '116', 'octagon-open', '216', '216', 'octagon-dot', '316', '316', 'octagon-open-dot', '17', '17', 'star', '117', '117', 'star-open', '217', '217', 'star-dot', '317', '317', 'star-open-dot', '18', '18', 'hexagram', '118', '118', 'hexagram-open', '218', '218', 'hexagram-dot', '318', '318', 'hexagram-open-dot', '19', '19', 'star-triangle-up', '119', '119', 'star-triangle-up-open', '219', '219', 'star-triangle-up-dot', '319', '319', 'star-triangle-up-open-dot', '20', '20', 'star-triangle-down', '120', '120', 'star-triangle-down-open', '220', '220', 'star-triangle-down-dot', '320', '320', 'star-triangle-down-open-dot', '21', '21', 'star-square', '121', '121', 'star-square-open', '221', '221', 'star-square-dot', '321', '321', 'star-square-open-dot', '22', '22', 'star-diamond', '122', '122', 'star-diamond-open', '222', '222', 'star-diamond-dot', '322', '322', 'star-diamond-open-dot', '23', '23', 'diamond-tall', '123', '123', 'diamond-tall-open', '223', '223', 'diamond-tall-dot', '323', '323', 'diamond-tall-open-dot', '24', '24', 'diamond-wide', '124', '124', 'diamond-wide-open', '224', '224', 'diamond-wide-dot', '324', '324', 'diamond-wide-open-dot', '25', '25', 'hourglass', '125', '125', 'hourglass-open', '26', '26', 'bowtie', '126', '126', 'bowtie-open', '27', '27', 'circle-cross', '127', '127', 'circle-cross-open', '28', '28', 'circle-x', '128', '128', 'circle-x-open', '29', '29', 'square-cross', '129', '129', 'square-cross-open', '30', '30', 'square-x', '130', '130', 'square-x-open', '31', '31', 'diamond-cross', '131', '131', 'diamond-cross-open', '32', '32', 'diamond-x', '132', '132', 'diamond-x-open', '33', '33', 'cross-thin', '133', '133', 'cross-thin-open', '34', '34', 'x-thin', '134', '134', 'x-thin-open', '35', '35', 'asterisk', '135', '135', 'asterisk-open', '36', '36', 'hash', '136', '136', 'hash-open', '236', '236', 'hash-dot', '336', '336', 'hash-open-dot', '37', '37', 'y-up', '137', '137', 'y-up-open', '38', '38', 'y-down', '138', '138', 'y-down-open', '39', '39', 'y-left', '139', '139', 'y-left-open', '40', '40', 'y-right', '140', '140', 'y-right-open', '41', '41', 'line-ew', '141', '141', 'line-ew-open', '42', '42', 'line-ns', '142', '142', 'line-ns-open', '43', '43', 'line-ne', '143', '143', 'line-ne-open', '44', '44', 'line-nw', '144', '144', 'line-nw-open', '45', '45', 'arrow-up', '145', '145', 'arrow-up-open', '46', '46', 'arrow-down', '146', '146', 'arrow-down-open', '47', '47', 'arrow-left', '147', '147', 'arrow-left-open', '48', '48', 'arrow-right', '148', '148', 'arrow-right-open', '49', '49', 'arrow-bar-up', '149', '149', 'arrow-bar-up-open', '50', '50', 'arrow-bar-down', '150', '150', 'arrow-bar-down-open', '51', '51', 'arrow-bar-left', '151', '151', 'arrow-bar-left-open', '52', '52', 'arrow-bar-right', '152', '152', 'arrow-bar-right-open', '53', '53', 'arrow', '153', '153', 'arrow-open', '54', '54', 'arrow-wide', '154', '154', 'arrow-wide-open
## Warning: The following are not valid symbol codes:
## 'NA'
## Valid symbols include:
## '0', '0', 'circle', '100', '100', 'circle-open', '200', '200', 'circle-dot', '300', '300', 'circle-open-dot', '1', '1', 'square', '101', '101', 'square-open', '201', '201', 'square-dot', '301', '301', 'square-open-dot', '2', '2', 'diamond', '102', '102', 'diamond-open', '202', '202', 'diamond-dot', '302', '302', 'diamond-open-dot', '3', '3', 'cross', '103', '103', 'cross-open', '203', '203', 'cross-dot', '303', '303', 'cross-open-dot', '4', '4', 'x', '104', '104', 'x-open', '204', '204', 'x-dot', '304', '304', 'x-open-dot', '5', '5', 'triangle-up', '105', '105', 'triangle-up-open', '205', '205', 'triangle-up-dot', '305', '305', 'triangle-up-open-dot', '6', '6', 'triangle-down', '106', '106', 'triangle-down-open', '206', '206', 'triangle-down-dot', '306', '306', 'triangle-down-open-dot', '7', '7', 'triangle-left', '107', '107', 'triangle-left-open', '207', '207', 'triangle-left-dot', '307', '307', 'triangle-left-open-dot', '8', '8', 'triangle-right', '108', '108', 'triangle-right-open', '208', '208', 'triangle-right-dot', '308', '308', 'triangle-right-open-dot', '9', '9', 'triangle-ne', '109', '109', 'triangle-ne-open', '209', '209', 'triangle-ne-dot', '309', '309', 'triangle-ne-open-dot', '10', '10', 'triangle-se', '110', '110', 'triangle-se-open', '210', '210', 'triangle-se-dot', '310', '310', 'triangle-se-open-dot', '11', '11', 'triangle-sw', '111', '111', 'triangle-sw-open', '211', '211', 'triangle-sw-dot', '311', '311', 'triangle-sw-open-dot', '12', '12', 'triangle-nw', '112', '112', 'triangle-nw-open', '212', '212', 'triangle-nw-dot', '312', '312', 'triangle-nw-open-dot', '13', '13', 'pentagon', '113', '113', 'pentagon-open', '213', '213', 'pentagon-dot', '313', '313', 'pentagon-open-dot', '14', '14', 'hexagon', '114', '114', 'hexagon-open', '214', '214', 'hexagon-dot', '314', '314', 'hexagon-open-dot', '15', '15', 'hexagon2', '115', '115', 'hexagon2-open', '215', '215', 'hexagon2-dot', '315', '315', 'hexagon2-open-dot', '16', '16', 'octagon', '116', '116', 'octagon-open', '216', '216', 'octagon-dot', '316', '316', 'octagon-open-dot', '17', '17', 'star', '117', '117', 'star-open', '217', '217', 'star-dot', '317', '317', 'star-open-dot', '18', '18', 'hexagram', '118', '118', 'hexagram-open', '218', '218', 'hexagram-dot', '318', '318', 'hexagram-open-dot', '19', '19', 'star-triangle-up', '119', '119', 'star-triangle-up-open', '219', '219', 'star-triangle-up-dot', '319', '319', 'star-triangle-up-open-dot', '20', '20', 'star-triangle-down', '120', '120', 'star-triangle-down-open', '220', '220', 'star-triangle-down-dot', '320', '320', 'star-triangle-down-open-dot', '21', '21', 'star-square', '121', '121', 'star-square-open', '221', '221', 'star-square-dot', '321', '321', 'star-square-open-dot', '22', '22', 'star-diamond', '122', '122', 'star-diamond-open', '222', '222', 'star-diamond-dot', '322', '322', 'star-diamond-open-dot', '23', '23', 'diamond-tall', '123', '123', 'diamond-tall-open', '223', '223', 'diamond-tall-dot', '323', '323', 'diamond-tall-open-dot', '24', '24', 'diamond-wide', '124', '124', 'diamond-wide-open', '224', '224', 'diamond-wide-dot', '324', '324', 'diamond-wide-open-dot', '25', '25', 'hourglass', '125', '125', 'hourglass-open', '26', '26', 'bowtie', '126', '126', 'bowtie-open', '27', '27', 'circle-cross', '127', '127', 'circle-cross-open', '28', '28', 'circle-x', '128', '128', 'circle-x-open', '29', '29', 'square-cross', '129', '129', 'square-cross-open', '30', '30', 'square-x', '130', '130', 'square-x-open', '31', '31', 'diamond-cross', '131', '131', 'diamond-cross-open', '32', '32', 'diamond-x', '132', '132', 'diamond-x-open', '33', '33', 'cross-thin', '133', '133', 'cross-thin-open', '34', '34', 'x-thin', '134', '134', 'x-thin-open', '35', '35', 'asterisk', '135', '135', 'asterisk-open', '36', '36', 'hash', '136', '136', 'hash-open', '236', '236', 'hash-dot', '336', '336', 'hash-open-dot', '37', '37', 'y-up', '137', '137', 'y-up-open', '38', '38', 'y-down', '138', '138', 'y-down-open', '39', '39', 'y-left', '139', '139', 'y-left-open', '40', '40', 'y-right', '140', '140', 'y-right-open', '41', '41', 'line-ew', '141', '141', 'line-ew-open', '42', '42', 'line-ns', '142', '142', 'line-ns-open', '43', '43', 'line-ne', '143', '143', 'line-ne-open', '44', '44', 'line-nw', '144', '144', 'line-nw-open', '45', '45', 'arrow-up', '145', '145', 'arrow-up-open', '46', '46', 'arrow-down', '146', '146', 'arrow-down-open', '47', '47', 'arrow-left', '147', '147', 'arrow-left-open', '48', '48', 'arrow-right', '148', '148', 'arrow-right-open', '49', '49', 'arrow-bar-up', '149', '149', 'arrow-bar-up-open', '50', '50', 'arrow-bar-down', '150', '150', 'arrow-bar-down-open', '51', '51', 'arrow-bar-left', '151', '151', 'arrow-bar-left-open', '52', '52', 'arrow-bar-right', '152', '152', 'arrow-bar-right-open', '53', '53', 'arrow', '153', '153', 'arrow-open', '54', '54', 'arrow-wide', '154', '154', 'arrow-wide-open
## Warning: The following are not valid symbol codes:
## 'NA'
## Valid symbols include:
## '0', '0', 'circle', '100', '100', 'circle-open', '200', '200', 'circle-dot', '300', '300', 'circle-open-dot', '1', '1', 'square', '101', '101', 'square-open', '201', '201', 'square-dot', '301', '301', 'square-open-dot', '2', '2', 'diamond', '102', '102', 'diamond-open', '202', '202', 'diamond-dot', '302', '302', 'diamond-open-dot', '3', '3', 'cross', '103', '103', 'cross-open', '203', '203', 'cross-dot', '303', '303', 'cross-open-dot', '4', '4', 'x', '104', '104', 'x-open', '204', '204', 'x-dot', '304', '304', 'x-open-dot', '5', '5', 'triangle-up', '105', '105', 'triangle-up-open', '205', '205', 'triangle-up-dot', '305', '305', 'triangle-up-open-dot', '6', '6', 'triangle-down', '106', '106', 'triangle-down-open', '206', '206', 'triangle-down-dot', '306', '306', 'triangle-down-open-dot', '7', '7', 'triangle-left', '107', '107', 'triangle-left-open', '207', '207', 'triangle-left-dot', '307', '307', 'triangle-left-open-dot', '8', '8', 'triangle-right', '108', '108', 'triangle-right-open', '208', '208', 'triangle-right-dot', '308', '308', 'triangle-right-open-dot', '9', '9', 'triangle-ne', '109', '109', 'triangle-ne-open', '209', '209', 'triangle-ne-dot', '309', '309', 'triangle-ne-open-dot', '10', '10', 'triangle-se', '110', '110', 'triangle-se-open', '210', '210', 'triangle-se-dot', '310', '310', 'triangle-se-open-dot', '11', '11', 'triangle-sw', '111', '111', 'triangle-sw-open', '211', '211', 'triangle-sw-dot', '311', '311', 'triangle-sw-open-dot', '12', '12', 'triangle-nw', '112', '112', 'triangle-nw-open', '212', '212', 'triangle-nw-dot', '312', '312', 'triangle-nw-open-dot', '13', '13', 'pentagon', '113', '113', 'pentagon-open', '213', '213', 'pentagon-dot', '313', '313', 'pentagon-open-dot', '14', '14', 'hexagon', '114', '114', 'hexagon-open', '214', '214', 'hexagon-dot', '314', '314', 'hexagon-open-dot', '15', '15', 'hexagon2', '115', '115', 'hexagon2-open', '215', '215', 'hexagon2-dot', '315', '315', 'hexagon2-open-dot', '16', '16', 'octagon', '116', '116', 'octagon-open', '216', '216', 'octagon-dot', '316', '316', 'octagon-open-dot', '17', '17', 'star', '117', '117', 'star-open', '217', '217', 'star-dot', '317', '317', 'star-open-dot', '18', '18', 'hexagram', '118', '118', 'hexagram-open', '218', '218', 'hexagram-dot', '318', '318', 'hexagram-open-dot', '19', '19', 'star-triangle-up', '119', '119', 'star-triangle-up-open', '219', '219', 'star-triangle-up-dot', '319', '319', 'star-triangle-up-open-dot', '20', '20', 'star-triangle-down', '120', '120', 'star-triangle-down-open', '220', '220', 'star-triangle-down-dot', '320', '320', 'star-triangle-down-open-dot', '21', '21', 'star-square', '121', '121', 'star-square-open', '221', '221', 'star-square-dot', '321', '321', 'star-square-open-dot', '22', '22', 'star-diamond', '122', '122', 'star-diamond-open', '222', '222', 'star-diamond-dot', '322', '322', 'star-diamond-open-dot', '23', '23', 'diamond-tall', '123', '123', 'diamond-tall-open', '223', '223', 'diamond-tall-dot', '323', '323', 'diamond-tall-open-dot', '24', '24', 'diamond-wide', '124', '124', 'diamond-wide-open', '224', '224', 'diamond-wide-dot', '324', '324', 'diamond-wide-open-dot', '25', '25', 'hourglass', '125', '125', 'hourglass-open', '26', '26', 'bowtie', '126', '126', 'bowtie-open', '27', '27', 'circle-cross', '127', '127', 'circle-cross-open', '28', '28', 'circle-x', '128', '128', 'circle-x-open', '29', '29', 'square-cross', '129', '129', 'square-cross-open', '30', '30', 'square-x', '130', '130', 'square-x-open', '31', '31', 'diamond-cross', '131', '131', 'diamond-cross-open', '32', '32', 'diamond-x', '132', '132', 'diamond-x-open', '33', '33', 'cross-thin', '133', '133', 'cross-thin-open', '34', '34', 'x-thin', '134', '134', 'x-thin-open', '35', '35', 'asterisk', '135', '135', 'asterisk-open', '36', '36', 'hash', '136', '136', 'hash-open', '236', '236', 'hash-dot', '336', '336', 'hash-open-dot', '37', '37', 'y-up', '137', '137', 'y-up-open', '38', '38', 'y-down', '138', '138', 'y-down-open', '39', '39', 'y-left', '139', '139', 'y-left-open', '40', '40', 'y-right', '140', '140', 'y-right-open', '41', '41', 'line-ew', '141', '141', 'line-ew-open', '42', '42', 'line-ns', '142', '142', 'line-ns-open', '43', '43', 'line-ne', '143', '143', 'line-ne-open', '44', '44', 'line-nw', '144', '144', 'line-nw-open', '45', '45', 'arrow-up', '145', '145', 'arrow-up-open', '46', '46', 'arrow-down', '146', '146', 'arrow-down-open', '47', '47', 'arrow-left', '147', '147', 'arrow-left-open', '48', '48', 'arrow-right', '148', '148', 'arrow-right-open', '49', '49', 'arrow-bar-up', '149', '149', 'arrow-bar-up-open', '50', '50', 'arrow-bar-down', '150', '150', 'arrow-bar-down-open', '51', '51', 'arrow-bar-left', '151', '151', 'arrow-bar-left-open', '52', '52', 'arrow-bar-right', '152', '152', 'arrow-bar-right-open', '53', '53', 'arrow', '153', '153', 'arrow-open', '54', '54', 'arrow-wide', '154', '154', 'arrow-wide-open
## Warning in RColorBrewer::brewer.pal(n, pal): n too large, allowed maximum for palette Dark2 is 8
## Returning the palette you asked for with that many colors
## Warning in RColorBrewer::brewer.pal(n, pal): n too large, allowed maximum for palette Dark2 is 8
## Returning the palette you asked for with that many colors
## Warning in RColorBrewer::brewer.pal(n, pal): n too large, allowed maximum for palette Dark2 is 8
## Returning the palette you asked for with that many colors
## Warning in RColorBrewer::brewer.pal(n, pal): n too large, allowed maximum for palette Dark2 is 8
## Returning the palette you asked for with that many colors
## Warning in RColorBrewer::brewer.pal(n, pal): n too large, allowed maximum for palette Dark2 is 8
## Returning the palette you asked for with that many colors
## Warning in RColorBrewer::brewer.pal(n, pal): n too large, allowed maximum for palette Dark2 is 8
## Returning the palette you asked for with that many colors
## Warning in RColorBrewer::brewer.pal(n, pal): n too large, allowed maximum for palette Dark2 is 8
## Returning the palette you asked for with that many colors
## Warning in RColorBrewer::brewer.pal(n, pal): n too large, allowed maximum for palette Dark2 is 8
## Returning the palette you asked for with that many colors
## Warning in RColorBrewer::brewer.pal(n, pal): n too large, allowed maximum for palette Dark2 is 8
## Returning the palette you asked for with that many colors
## Warning in RColorBrewer::brewer.pal(n, pal): n too large, allowed maximum for palette Dark2 is 8
## Returning the palette you asked for with that many colors
## Warning in RColorBrewer::brewer.pal(n, pal): n too large, allowed maximum for palette Dark2 is 8
## Returning the palette you asked for with that many colors
## Warning in RColorBrewer::brewer.pal(n, pal): n too large, allowed maximum for palette Dark2 is 8
## Returning the palette you asked for with that many colors
## Warning in RColorBrewer::brewer.pal(n, pal): n too large, allowed maximum for palette Dark2 is 8
## Returning the palette you asked for with that many colors
## Warning in RColorBrewer::brewer.pal(n, pal): n too large, allowed maximum for palette Dark2 is 8
## Returning the palette you asked for with that many colors
## Warning in RColorBrewer::brewer.pal(n, pal): n too large, allowed maximum for palette Dark2 is 8
## Returning the palette you asked for with that many colors
## Warning in RColorBrewer::brewer.pal(n, pal): n too large, allowed maximum for palette Dark2 is 8
## Returning the palette you asked for with that many colors
## Warning in RColorBrewer::brewer.pal(n, pal): n too large, allowed maximum for palette Dark2 is 8
## Returning the palette you asked for with that many colors
## Warning in RColorBrewer::brewer.pal(n, pal): n too large, allowed maximum for palette Dark2 is 8
## Returning the palette you asked for with that many colors
## Warning in RColorBrewer::brewer.pal(n, pal): n too large, allowed maximum for palette Dark2 is 8
## Returning the palette you asked for with that many colors
## Warning in RColorBrewer::brewer.pal(n, pal): n too large, allowed maximum for palette Dark2 is 8
## Returning the palette you asked for with that many colors
## Warning in RColorBrewer::brewer.pal(n, pal): n too large, allowed maximum for palette Dark2 is 8
## Returning the palette you asked for with that many colors
## Warning in RColorBrewer::brewer.pal(n, pal): n too large, allowed maximum for palette Dark2 is 8
## Returning the palette you asked for with that many colors

The intent of the plot above is to assess the correlation between sleep duration and physical activity level. In addition, I wanted to plot some of the other health related data points in the hover text so that the user can look at how the sleep and activity levels did or did not impact other health factors. Looking at the plotted points, there does appear to be a positive correlation between physical activity and sleep; physical activity improves sleep and vice versa. I also find it interesting to see that there isn’t a noticeable relationship to the person’s occupation.

Problem 2 [20 points]

Create an animated plotly graph with a data set of your choosing. This can be, but does not have to be a scatter plot. Also, the animation does not have to take place over time. As mentioned in the notes, the frame can be set to a categorical variable. However, the categories the frames cycle through should be organized (if needs be) such that the progression through them shows some pattern or trend.

This graph should include:

  1. Aside from the graphing variable, a separate categorical variable. For example, in our animated scatter plot we color grouped the points by continent.

  2. Appropriate axis labels and a title

  3. Augment the frame label to make it more visible. This can include changing the font size and color to make it stand out more, and/or moving the frame label to a new location in the plotting region. Note, if you do this, make sure it is still clearly visible and does not obstruct the view of your plot.

Include at least a 1-paragraph discussion about the plot. Discuss what you are plotting and what trends can be seen throughout the animation. Discuss any issues, if any, you ran into in making the plot and how you overcame them.

#Load Data Set

cars <- read.csv("C:/Users/kimbr/Masters Program/STAT 5110/Week 5/Homework/Problem 2/table_export.csv", 
                     header = TRUE)
#View(cars)
cars$Production..000. <- as.numeric(cars$Production..000.)
## Warning: NAs introduced by coercion
cars$Real.World.MPG <- as.numeric(cars$Real.World.MPG)
## Warning: NAs introduced by coercion
cars$Weight..lbs. <- as.numeric(cars$Weight..lbs.)
## Warning: NAs introduced by coercion
cars %>%
  plot_ly(x = ~Real.World.MPG, 
          y = ~Weight..lbs.,
          hoverinfo = "text",
          text = ~paste("Manufacturer:", Manufacturer,
                        "<br># Produced(,000):", Production..000.)) %>%
  add_markers(frame = ~Model.Year, 
              showlegend = TRUE,
              size = ~Production..000., 
              ids = ~Manufacturer, 
              color = ~Vehicle.Type,
              marker = list(sizemode = "diameter",
                            sizeref = 1.5)) %>%
layout(
  xaxis = list(title = "Miles Per Gallon",
               color = toRGB("blue")),
  yaxis = list(title = "Vehicle Weight (pounds)",
               color = toRGB("blue")),
  title = list(text = "Vehicle Weight vs Fuel Efficiency Over Time",
               font = list(
                 color = "darkblue",
                 size = 20),
               x = 0.15, y = 0.975)) %>%
  
animation_slider(currentvalue = list(prefix="Model Year: ",
                                     font = list(color = "maroon",
                                                 size = 25)))
## Warning: Ignoring 1282 observations
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.

This plot shows the relationship between vehicle weight and MPG over time. I really found the evolution of vehicle weight to be interesting as I expected vehicles made in the early years to be very heavy and, thus, not fuel efficient. As time went one, vehicles became heavier even though more plastic materials were used, but they also became more fuel efficient. I wish that the dataset had better breakouts so that so many vehicles did not fall into the “All” bucket. I did consider scrubbing that data, but I was worried that I would lose too much important information. My biggest challenge was troubleshooting why my rounding of the numbers on the x and y axes was not working. Once I figured out that they came in as characters and needed to be converted to numerical variables, everything was fine. I do find this interaction between the two variables to be interesting and the graph was fairly easy and fun to set up.

What to turn in: