{"id":96127,"date":"2021-08-19T10:55:00","date_gmt":"2021-08-19T14:55:00","guid":{"rendered":"https:\/\/ibkrcampus.com\/?p=96127"},"modified":"2023-02-16T16:00:43","modified_gmt":"2023-02-16T21:00:43","slug":"how-to-fill-gaps-in-large-stock-data-universes-using-tidyr-and-dplyr-part-ii","status":"publish","type":"post","link":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/how-to-fill-gaps-in-large-stock-data-universes-using-tidyr-and-dplyr-part-ii\/","title":{"rendered":"How to Fill Gaps in Large Stock Data Universes Using tidyr and dplyr \u2013 Part II"},"content":{"rendered":"\n<p><em>Get started with <a href=\"\/campus\/ibkr-quant-news\/how-to-fill-gaps-in-large-stock-data-universes-using-tidyr-and-dplyr-part-i\/\">Part I<\/a>.<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-another-approach\">Another approach<\/h3>\n\n\n\n<p>There\u2019s also a more verbose way to achieve our aim, and I\u2019m showing it here because I think it\u2019s useful to see how different functions and libraries connect and cross-over in the tidyverse (right now I\u2019m fascinated by the intersection of the&nbsp;<code>purrr::map<\/code>&nbsp;functions and the&nbsp;<code>dplyr::summarise_if, _at, _all<\/code>&nbsp;functions\u2026but that\u2019s a story for another time).<\/p>\n\n\n\n<p>The verbose approach is as follows:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>use&nbsp;<code>tidyr::pivot_wide<\/code>&nbsp;to reshape the data to row per date, with a column for each stock<\/li><li>use&nbsp;<code>tidyr::pivot_long<\/code>&nbsp;to reshape it back to its longer format.<\/li><\/ul>\n\n\n\n<p>Let\u2019s do it step by step\u2026<\/p>\n\n\n\n<p>First, we make it wide:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>widedata &lt;- testdata %&gt;%\n  pivot_wider(id_cols = date, names_from = ticker, values_from = returns)\nwidedata<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>## # A tibble: 3 x 4\n##    date  AMZN    FB  TSLA\n##   &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt;\n## 1     1  0.01  0.02 NA   \n## 2     2  0.03  0.04  0.05\n## 3     3  0.06 NA     0.07<\/code><\/pre>\n\n\n\n<p>Where we had missing rows, we now have&nbsp;<code>NA<\/code>.<\/p>\n\n\n\n<p>Now we make it long again:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tidydata &lt;- widedata %&gt;%\n  pivot_longer(-date, names_to = 'ticker', values_to =  'returns')\ntidydata<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>## # A tibble: 9 x 3\n##    date ticker returns\n##   &lt;dbl&gt; &lt;chr&gt;    &lt;dbl&gt;\n## 1     1 AMZN      0.01\n## 2     1 FB        0.02\n## 3     1 TSLA     NA   \n## 4     2 AMZN      0.03\n## 5     2 FB        0.04\n## 6     2 TSLA      0.05\n## 7     3 AMZN      0.06\n## 8     3 FB       NA   \n## 9     3 TSLA      0.07<\/code><\/pre>\n\n\n\n<p>And again we have a row for every date for every stock.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tidydata %&gt;%\n  group_by(ticker) %&gt;%\n  summarise(count = n())<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>## # A tibble: 3 x 2\n##   ticker count\n##   &lt;chr&gt;  &lt;int&gt;\n## 1 AMZN       3\n## 2 FB         3\n## 3 TSLA       3<\/code><\/pre>\n\n\n\n<p>Here\u2019s the complete pipeline:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>testdata %&gt;%\n  pivot_wider(id_cols = date, names_from = ticker, values_from = returns) %&gt;%\n  pivot_longer(-date, names_to = 'ticker', values_to =  'returns')<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>## # A tibble: 9 x 3\n##    date ticker returns\n##   &lt;dbl&gt; &lt;chr&gt;    &lt;dbl&gt;\n## 1     1 AMZN      0.01\n## 2     1 FB        0.02\n## 3     1 TSLA     NA   \n## 4     2 AMZN      0.03\n## 5     2 FB        0.04\n## 6     2 TSLA      0.05\n## 7     3 AMZN      0.06\n## 8     3 FB       NA   \n## 9     3 TSLA      0.07<\/code><\/pre>\n\n\n\n<p><em>Stay tuned for the next installment in which the author will explore what happens if we have more than one variable in our original data.<\/em><\/p>\n\n\n\n<p><em>Visit Robot Wealth website for additional insight<\/em>:&nbsp;<a href=\"https:\/\/robotwealth.com\/using-python-from-the-comfort-of-r-studio\/\"><em>https:\/\/robotwealth.com\/how-to-fill-gaps-in-large-stock-data-universes-using-tidyr-and-dplyr\/<\/em><\/a><\/p>\n\n\n\n<p><em>Past performance is not indicative of future results.<\/em><\/p>\n\n\n\n<p><em>Any stock, options or futures symbols displayed are for illustrative purposes only and are not intended to portray recommendations.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>There\u2019s also a more verbose way to achieve our aim, and I\u2019m showing it here because I think it\u2019s useful to see how different functions and libraries connect and cross-over in the tidyverse.<\/p>\n","protected":false},"author":421,"featured_media":80184,"comment_status":"closed","ping_status":"open","sticky":true,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[339,343,349,338,350,341,344,342],"tags":[806,2535,6591,508,10114,8594,1045],"contributors-categories":[13676],"class_list":{"0":"post-96127","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-data-science","8":"category-programing-languages","9":"category-python-development","10":"category-ibkr-quant-news","11":"category-quant-asia-pacific","12":"category-quant-development","13":"category-quant-regions","14":"category-r-development","15":"tag-data-science","16":"tag-dplyr","17":"tag-rstats","18":"tag-rstudio","19":"tag-tidydata","20":"tag-tidyr","21":"tag-tidyverse","22":"contributors-categories-robot-wealth"},"pp_statuses_selecting_workflow":false,"pp_workflow_action":"current","pp_status_selection":"publish","acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.9 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How to Fill Gaps in Large Stock Data Universes Using tidyr and dplyr \u2013 Part II<\/title>\n<meta name=\"description\" content=\"There\u2019s also a more verbose way to achieve our aim, and I\u2019m showing it here because I think it\u2019s useful to see how different functions and...\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.interactivebrokers.com\/campus\/wp-json\/wp\/v2\/posts\/96127\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Fill Gaps in Large Stock Data Universes Using tidyr and dplyr \u2013 Part II | IBKR Quant Blog\" \/>\n<meta property=\"og:description\" content=\"There\u2019s also a more verbose way to achieve our aim, and I\u2019m showing it here because I think it\u2019s useful to see how different functions and libraries connect and cross-over in the tidyverse.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/how-to-fill-gaps-in-large-stock-data-universes-using-tidyr-and-dplyr-part-ii\/\" \/>\n<meta property=\"og:site_name\" content=\"IBKR Campus US\" \/>\n<meta property=\"article:published_time\" content=\"2021-08-19T14:55:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-02-16T21:00:43+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2021\/03\/R-programing.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"900\" \/>\n\t<meta property=\"og:image:height\" content=\"550\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Robot James\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Robot James\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\n\t    \"@context\": \"https:\\\/\\\/schema.org\",\n\t    \"@graph\": [\n\t        {\n\t            \"@type\": \"NewsArticle\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/how-to-fill-gaps-in-large-stock-data-universes-using-tidyr-and-dplyr-part-ii\\\/#article\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/how-to-fill-gaps-in-large-stock-data-universes-using-tidyr-and-dplyr-part-ii\\\/\"\n\t            },\n\t            \"author\": {\n\t                \"name\": \"Robot James\",\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/person\\\/0fcf297a219d9485e2efa476d632b468\"\n\t            },\n\t            \"headline\": \"How to Fill Gaps in Large Stock Data Universes Using tidyr and dplyr \u2013 Part II\",\n\t            \"datePublished\": \"2021-08-19T14:55:00+00:00\",\n\t            \"dateModified\": \"2023-02-16T21:00:43+00:00\",\n\t            \"mainEntityOfPage\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/how-to-fill-gaps-in-large-stock-data-universes-using-tidyr-and-dplyr-part-ii\\\/\"\n\t            },\n\t            \"wordCount\": 226,\n\t            \"publisher\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/how-to-fill-gaps-in-large-stock-data-universes-using-tidyr-and-dplyr-part-ii\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2021\\\/03\\\/R-programing.jpg\",\n\t            \"keywords\": [\n\t                \"Data Science\",\n\t                \"dplyr\",\n\t                \"rstats\",\n\t                \"RStudio\",\n\t                \"tidydata\",\n\t                \"tidyr\",\n\t                \"tidyverse\"\n\t            ],\n\t            \"articleSection\": [\n\t                \"Data Science\",\n\t                \"Programming Languages\",\n\t                \"Python Development\",\n\t                \"Quant\",\n\t                \"Quant Asia Pacific\",\n\t                \"Quant Development\",\n\t                \"Quant Regions\",\n\t                \"R Development\"\n\t            ],\n\t            \"inLanguage\": \"en-US\"\n\t        },\n\t        {\n\t            \"@type\": \"WebPage\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/how-to-fill-gaps-in-large-stock-data-universes-using-tidyr-and-dplyr-part-ii\\\/\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/how-to-fill-gaps-in-large-stock-data-universes-using-tidyr-and-dplyr-part-ii\\\/\",\n\t            \"name\": \"How to Fill Gaps in Large Stock Data Universes Using tidyr and dplyr \u2013 Part II | IBKR Quant Blog\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#website\"\n\t            },\n\t            \"primaryImageOfPage\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/how-to-fill-gaps-in-large-stock-data-universes-using-tidyr-and-dplyr-part-ii\\\/#primaryimage\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/how-to-fill-gaps-in-large-stock-data-universes-using-tidyr-and-dplyr-part-ii\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2021\\\/03\\\/R-programing.jpg\",\n\t            \"datePublished\": \"2021-08-19T14:55:00+00:00\",\n\t            \"dateModified\": \"2023-02-16T21:00:43+00:00\",\n\t            \"description\": \"There\u2019s also a more verbose way to achieve our aim, and I\u2019m showing it here because I think it\u2019s useful to see how different functions and libraries connect and cross-over in the tidyverse.\",\n\t            \"inLanguage\": \"en-US\",\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"ReadAction\",\n\t                    \"target\": [\n\t                        \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/how-to-fill-gaps-in-large-stock-data-universes-using-tidyr-and-dplyr-part-ii\\\/\"\n\t                    ]\n\t                }\n\t            ]\n\t        },\n\t        {\n\t            \"@type\": \"ImageObject\",\n\t            \"inLanguage\": \"en-US\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/how-to-fill-gaps-in-large-stock-data-universes-using-tidyr-and-dplyr-part-ii\\\/#primaryimage\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2021\\\/03\\\/R-programing.jpg\",\n\t            \"contentUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2021\\\/03\\\/R-programing.jpg\",\n\t            \"width\": 900,\n\t            \"height\": 550,\n\t            \"caption\": \"R Programming\"\n\t        },\n\t        {\n\t            \"@type\": \"WebSite\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#website\",\n\t            \"url\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/\",\n\t            \"name\": \"IBKR Campus US\",\n\t            \"description\": \"Financial Education from Interactive Brokers\",\n\t            \"publisher\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\"\n\t            },\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"SearchAction\",\n\t                    \"target\": {\n\t                        \"@type\": \"EntryPoint\",\n\t                        \"urlTemplate\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/?s={search_term_string}\"\n\t                    },\n\t                    \"query-input\": {\n\t                        \"@type\": \"PropertyValueSpecification\",\n\t                        \"valueRequired\": true,\n\t                        \"valueName\": \"search_term_string\"\n\t                    }\n\t                }\n\t            ],\n\t            \"inLanguage\": \"en-US\"\n\t        },\n\t        {\n\t            \"@type\": \"Organization\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\",\n\t            \"name\": \"Interactive Brokers\",\n\t            \"alternateName\": \"IBKR\",\n\t            \"url\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/\",\n\t            \"logo\": {\n\t                \"@type\": \"ImageObject\",\n\t                \"inLanguage\": \"en-US\",\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/logo\\\/image\\\/\",\n\t                \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2024\\\/05\\\/ibkr-campus-logo.jpg\",\n\t                \"contentUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2024\\\/05\\\/ibkr-campus-logo.jpg\",\n\t                \"width\": 669,\n\t                \"height\": 669,\n\t                \"caption\": \"Interactive Brokers\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/logo\\\/image\\\/\"\n\t            },\n\t            \"publishingPrinciples\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/about-ibkr-campus\\\/\",\n\t            \"ethicsPolicy\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/cyber-security-notice\\\/\"\n\t        },\n\t        {\n\t            \"@type\": \"Person\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/person\\\/0fcf297a219d9485e2efa476d632b468\",\n\t            \"name\": \"Robot James\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/author\\\/robotjames\\\/\"\n\t        }\n\t    ]\n\t}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Fill Gaps in Large Stock Data Universes Using tidyr and dplyr \u2013 Part II","description":"There\u2019s also a more verbose way to achieve our aim, and I\u2019m showing it here because I think it\u2019s useful to see how different functions and...","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.interactivebrokers.com\/campus\/wp-json\/wp\/v2\/posts\/96127\/","og_locale":"en_US","og_type":"article","og_title":"How to Fill Gaps in Large Stock Data Universes Using tidyr and dplyr \u2013 Part II | IBKR Quant Blog","og_description":"There\u2019s also a more verbose way to achieve our aim, and I\u2019m showing it here because I think it\u2019s useful to see how different functions and libraries connect and cross-over in the tidyverse.","og_url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/how-to-fill-gaps-in-large-stock-data-universes-using-tidyr-and-dplyr-part-ii\/","og_site_name":"IBKR Campus US","article_published_time":"2021-08-19T14:55:00+00:00","article_modified_time":"2023-02-16T21:00:43+00:00","og_image":[{"width":900,"height":550,"url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2021\/03\/R-programing.jpg","type":"image\/jpeg"}],"author":"Robot James","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Robot James","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"NewsArticle","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/how-to-fill-gaps-in-large-stock-data-universes-using-tidyr-and-dplyr-part-ii\/#article","isPartOf":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/how-to-fill-gaps-in-large-stock-data-universes-using-tidyr-and-dplyr-part-ii\/"},"author":{"name":"Robot James","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/person\/0fcf297a219d9485e2efa476d632b468"},"headline":"How to Fill Gaps in Large Stock Data Universes Using tidyr and dplyr \u2013 Part II","datePublished":"2021-08-19T14:55:00+00:00","dateModified":"2023-02-16T21:00:43+00:00","mainEntityOfPage":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/how-to-fill-gaps-in-large-stock-data-universes-using-tidyr-and-dplyr-part-ii\/"},"wordCount":226,"publisher":{"@id":"https:\/\/ibkrcampus.com\/campus\/#organization"},"image":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/how-to-fill-gaps-in-large-stock-data-universes-using-tidyr-and-dplyr-part-ii\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2021\/03\/R-programing.jpg","keywords":["Data Science","dplyr","rstats","RStudio","tidydata","tidyr","tidyverse"],"articleSection":["Data Science","Programming Languages","Python Development","Quant","Quant Asia Pacific","Quant Development","Quant Regions","R Development"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/how-to-fill-gaps-in-large-stock-data-universes-using-tidyr-and-dplyr-part-ii\/","url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/how-to-fill-gaps-in-large-stock-data-universes-using-tidyr-and-dplyr-part-ii\/","name":"How to Fill Gaps in Large Stock Data Universes Using tidyr and dplyr \u2013 Part II | IBKR Quant Blog","isPartOf":{"@id":"https:\/\/ibkrcampus.com\/campus\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/how-to-fill-gaps-in-large-stock-data-universes-using-tidyr-and-dplyr-part-ii\/#primaryimage"},"image":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/how-to-fill-gaps-in-large-stock-data-universes-using-tidyr-and-dplyr-part-ii\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2021\/03\/R-programing.jpg","datePublished":"2021-08-19T14:55:00+00:00","dateModified":"2023-02-16T21:00:43+00:00","description":"There\u2019s also a more verbose way to achieve our aim, and I\u2019m showing it here because I think it\u2019s useful to see how different functions and libraries connect and cross-over in the tidyverse.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/how-to-fill-gaps-in-large-stock-data-universes-using-tidyr-and-dplyr-part-ii\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/how-to-fill-gaps-in-large-stock-data-universes-using-tidyr-and-dplyr-part-ii\/#primaryimage","url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2021\/03\/R-programing.jpg","contentUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2021\/03\/R-programing.jpg","width":900,"height":550,"caption":"R Programming"},{"@type":"WebSite","@id":"https:\/\/ibkrcampus.com\/campus\/#website","url":"https:\/\/ibkrcampus.com\/campus\/","name":"IBKR Campus US","description":"Financial Education from Interactive Brokers","publisher":{"@id":"https:\/\/ibkrcampus.com\/campus\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ibkrcampus.com\/campus\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/ibkrcampus.com\/campus\/#organization","name":"Interactive Brokers","alternateName":"IBKR","url":"https:\/\/ibkrcampus.com\/campus\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/logo\/image\/","url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/05\/ibkr-campus-logo.jpg","contentUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/05\/ibkr-campus-logo.jpg","width":669,"height":669,"caption":"Interactive Brokers"},"image":{"@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/logo\/image\/"},"publishingPrinciples":"https:\/\/www.interactivebrokers.com\/campus\/about-ibkr-campus\/","ethicsPolicy":"https:\/\/www.interactivebrokers.com\/campus\/cyber-security-notice\/"},{"@type":"Person","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/person\/0fcf297a219d9485e2efa476d632b468","name":"Robot James","url":"https:\/\/www.interactivebrokers.com\/campus\/author\/robotjames\/"}]}},"jetpack_featured_media_url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2021\/03\/R-programing.jpg","_links":{"self":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/96127","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/users\/421"}],"replies":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/comments?post=96127"}],"version-history":[{"count":0,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/96127\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media\/80184"}],"wp:attachment":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media?parent=96127"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/categories?post=96127"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/tags?post=96127"},{"taxonomy":"contributors-categories","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/contributors-categories?post=96127"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}