{"id":34,"date":"2022-11-10T09:38:45","date_gmt":"2022-11-10T09:38:45","guid":{"rendered":"https:\/\/dcarr-projects.com\/?p=34"},"modified":"2022-11-10T09:38:46","modified_gmt":"2022-11-10T09:38:46","slug":"adding-ride-length-to-our-sheets","status":"publish","type":"post","link":"https:\/\/dcarr-projects.com\/index.php\/2022\/11\/10\/adding-ride-length-to-our-sheets\/","title":{"rendered":"Adding &#8220;Ride Length&#8221; to Our Sheets"},"content":{"rendered":"\n<p>The first new column that we will add onto our sheets is meant to show the amount of time that each individual ride lasted for. We will call it &#8220;ride_length&#8221;, keeping with the naming convention found in the other columns. <\/p>\n\n\n\n<p>Specifically, we will continue to use an underscore to replace spaces in the titles of our columns. This will make it easier to use these column titles once we start our work in the R program. <\/p>\n\n\n\n<p>In order to get the ride length for each row, we will need to start at the first row and enter a simple Excel function. We will subtract the end time (found in the D column as &#8220;ended_at&#8221;) from the start time (found in the C column as &#8220;started_at&#8221;).  <\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" width=\"461\" height=\"261\" src=\"https:\/\/dcarr-projects.com\/wp-content\/uploads\/2022\/09\/Adding-Ride-Length-1-1.png\" alt=\"\" class=\"wp-image-145\" srcset=\"https:\/\/dcarr-projects.com\/wp-content\/uploads\/2022\/09\/Adding-Ride-Length-1-1.png 461w, https:\/\/dcarr-projects.com\/wp-content\/uploads\/2022\/09\/Adding-Ride-Length-1-1-300x170.png 300w\" sizes=\"(max-width: 461px) 100vw, 461px\" \/><\/figure><\/div>\n\n\n<p>When we do this for the first row, we end up with a decimal point value, rather than a value of time. <\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" width=\"317\" height=\"175\" src=\"https:\/\/dcarr-projects.com\/wp-content\/uploads\/2022\/09\/Adding-Ride-Length-Decimal-Value.png\" alt=\"\" class=\"wp-image-147\" srcset=\"https:\/\/dcarr-projects.com\/wp-content\/uploads\/2022\/09\/Adding-Ride-Length-Decimal-Value.png 317w, https:\/\/dcarr-projects.com\/wp-content\/uploads\/2022\/09\/Adding-Ride-Length-Decimal-Value-300x166.png 300w\" sizes=\"(max-width: 317px) 100vw, 317px\" \/><\/figure><\/div>\n\n\n<p>This will not do. We&#8217;re going to need to change the our value into a time format which will show how much time has passed during the trip. To do this, we are going to go to the format section of our Excel menu while the cell is still selected. From there, we&#8217;ll click &#8220;More Number Formats&#8221;. <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" width=\"525\" height=\"651\" src=\"https:\/\/dcarr-projects.com\/wp-content\/uploads\/2022\/09\/Adding-Ride-Length-More-Number-formats.png\" alt=\"\" class=\"wp-image-148\" srcset=\"https:\/\/dcarr-projects.com\/wp-content\/uploads\/2022\/09\/Adding-Ride-Length-More-Number-formats.png 525w, https:\/\/dcarr-projects.com\/wp-content\/uploads\/2022\/09\/Adding-Ride-Length-More-Number-formats-242x300.png 242w\" sizes=\"(max-width: 525px) 100vw, 525px\" \/><\/figure>\n\n\n\n<p>Once the Number Format page is open, we will select the &#8220;Time&#8221; option from the side panel. The main panel will list a set of time formats that we can choose from. We are going to choose the format that shows the hours, minutes, and seconds of a value. It will be in the format of &#8220;hh:mm:ss&#8221;, with each letter representing each of the prior measurements of time respectively. With that format selected, we will click &#8220;Ok&#8221;. Before we click &#8220;Ok&#8221; and close out that window, it should looks something like this:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" width=\"615\" height=\"483\" src=\"https:\/\/dcarr-projects.com\/wp-content\/uploads\/2022\/09\/Adding-Ride-Length-Correct-Format.png\" alt=\"\" class=\"wp-image-149\" srcset=\"https:\/\/dcarr-projects.com\/wp-content\/uploads\/2022\/09\/Adding-Ride-Length-Correct-Format.png 615w, https:\/\/dcarr-projects.com\/wp-content\/uploads\/2022\/09\/Adding-Ride-Length-Correct-Format-300x236.png 300w\" sizes=\"(max-width: 615px) 100vw, 615px\" \/><\/figure>\n\n\n\n<p>When we look back to our &#8220;ride_length&#8221; column, there should be be a value within that first cell that is in our selected format. Now, all we need to do is double click the small square at the corner of the cell. This applies the function that we used earlier across the entire column.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" src=\"https:\/\/dcarr-projects.com\/wp-content\/uploads\/2022\/09\/Adding-Ride-Length-2-1.png\" alt=\"\" class=\"wp-image-150\" width=\"271\" height=\"202\"\/><figcaption>This is the First Cell.<\/figcaption><\/figure><\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" src=\"https:\/\/dcarr-projects.com\/wp-content\/uploads\/2022\/09\/Adding-Ride-Length-Final.png\" alt=\"\" class=\"wp-image-151\" width=\"358\" height=\"234\"\/><figcaption>The rest of the cells will fill once you click the Green Square on the First Cell<\/figcaption><\/figure><\/div>\n\n\n<p>With the &#8220;ride_length&#8221; column completed in this first spreadsheet, we will need to save our results to a new folder that we will call &#8220;Edited Data V1 CSV&#8221;. The name of this file for January will be &#8220;2021-01-tripdata.csv&#8221;. Once this first spreadsheet is saved, the last thing we will need to do for this column is to repeat all of the previous steps into each file until all 12 months have a &#8220;ride_length&#8221; column added to them. <\/p>\n\n\n\n<p>By the end of this process, all of our monthly datasets should have a new &#8220;ride_length&#8221; column added to them. In the next posts, we will continue to add more columns to our datasets. In order to do that, we will need to use the R programming language. <\/p>\n\n\n\n<div class=\"wp-container-1 is-content-justification-center wp-block-buttons\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link\" href=\"https:\/\/dcarr-projects.com\/?p=24\">Previous Page: Format<\/a><\/div>\n\n\n\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link\" href=\"https:\/\/dcarr-projects.com\/?page_id=11\">Main Page<\/a><\/div>\n\n\n\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link\" href=\"https:\/\/dcarr-projects.com\/?p=38\">Next Page: Using R <\/a><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>The first new column that we will add onto our sheets is meant to show the amount of time that each individual ride lasted for. We will call it &#8220;ride_length&#8221;, keeping with the naming convention found in the other columns. Specifically, we will continue to use an underscore to replace spaces in the titles of&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false},"categories":[3],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/dcarr-projects.com\/index.php\/wp-json\/wp\/v2\/posts\/34"}],"collection":[{"href":"https:\/\/dcarr-projects.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dcarr-projects.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dcarr-projects.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dcarr-projects.com\/index.php\/wp-json\/wp\/v2\/comments?post=34"}],"version-history":[{"count":8,"href":"https:\/\/dcarr-projects.com\/index.php\/wp-json\/wp\/v2\/posts\/34\/revisions"}],"predecessor-version":[{"id":344,"href":"https:\/\/dcarr-projects.com\/index.php\/wp-json\/wp\/v2\/posts\/34\/revisions\/344"}],"wp:attachment":[{"href":"https:\/\/dcarr-projects.com\/index.php\/wp-json\/wp\/v2\/media?parent=34"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dcarr-projects.com\/index.php\/wp-json\/wp\/v2\/categories?post=34"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dcarr-projects.com\/index.php\/wp-json\/wp\/v2\/tags?post=34"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}