{"id":1728,"date":"2020-06-28T22:25:34","date_gmt":"2020-06-28T22:25:34","guid":{"rendered":"http:\/\/optimumsportsperformance.com\/blog\/?p=1728"},"modified":"2020-07-01T16:41:17","modified_gmt":"2020-07-01T16:41:17","slug":"tidyx-episode-16-web-scraping-nba-shot-charts","status":"publish","type":"post","link":"https:\/\/optimumsportsperformance.com\/blog\/tidyx-episode-16-web-scraping-nba-shot-charts\/","title":{"rendered":"TidyX Episode 16: Web Scraping &#038; NBA Shot Charts"},"content":{"rendered":"<p>This week, <span style=\"color: #0000ff;\"><strong><a style=\"color: #0000ff;\" href=\"https:\/\/twitter.com\/ellis_hughes\">Ellis Hughes<\/a><\/strong><\/span> and I start by breaking down the code that <strong><span style=\"color: #0000ff;\"><a style=\"color: #0000ff;\" href=\"https:\/\/twitter.com\/jihongzgamma\/status\/1275810075110780928\">Jihong Zhang<\/a><\/span><\/strong> wrote to visualize Caribou Movements in Canada from data provided by the <strong><span style=\"color: #0000ff;\"><a style=\"color: #0000ff;\" href=\"https:\/\/github.com\/rfordatascience\/tidytuesday\">TidyTuesday Project<\/a><\/span><\/strong>. The data is spatial tracking data and Jihong plotted this data over top of a google map. Since spatial data is currently very popular in sport, we decided to create our own plots of NBA Shot Charts using three different approaches (scatter plots, hexbins, and heat maps). To obtain this data, we walk through our code on web scraping.<\/p>\n<p>This screen cast covers a number of key topics in data science:<\/p>\n<p>1. Obtaining data via web scraping.<br \/>\n2. Dealing with regularized expressions.<br \/>\n3. Visualizing data.<br \/>\n4. Some things to consider when joining tables (<strong>NOTE:<\/strong> I did a <strong><span style=\"color: #0000ff;\"><a style=\"color: #0000ff;\" href=\"https:\/\/optimumsportsperformance.com\/blog\/r-tips-tricks-joining-data-sets\/\">BLOG ARTICLE<\/a><\/span><\/strong> a few months ago that details the various JOIN functions in {<em><strong>tidyverse<\/strong><\/em>}, so it may be worthwhile to check that out).<\/p>\n<p>To watch the screen cast, <strong><span style=\"color: #0000ff;\"><a style=\"color: #0000ff;\" href=\"https:\/\/www.youtube.com\/watch?v=l8_lTs9PSZA&amp;feature=youtu.be\">CLICK HERE<\/a><\/span><\/strong>.<\/p>\n<p>To access our code, <strong><span style=\"color: #0000ff;\"><a style=\"color: #0000ff;\" href=\"https:\/\/github.com\/thebioengineer\/TidyX\/tree\/master\/TidyTuesday_Explained\">CLICK HERE<\/a><\/span><\/strong>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This week, Ellis Hughes and I start by breaking down the code that Jihong Zhang wrote to visualize Caribou Movements in Canada from data provided by the TidyTuesday Project. The data is spatial tracking data and Jihong plotted this data over top of a google map. Since spatial data is currently very popular in sport, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[44],"tags":[],"class_list":["post-1728","post","type-post","status-publish","format-standard","hentry","category-tidyx-screen-cast"],"_links":{"self":[{"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/posts\/1728","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/comments?post=1728"}],"version-history":[{"count":1,"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/posts\/1728\/revisions"}],"predecessor-version":[{"id":1729,"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/posts\/1728\/revisions\/1729"}],"wp:attachment":[{"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/media?parent=1728"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/categories?post=1728"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/tags?post=1728"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}