{"id":2689,"date":"2022-11-06T20:49:23","date_gmt":"2022-11-06T20:49:23","guid":{"rendered":"http:\/\/optimumsportsperformance.com\/blog\/?p=2689"},"modified":"2022-11-07T13:37:29","modified_gmt":"2022-11-07T13:37:29","slug":"tidyx-episode-123-using-crossing-to-build-data-sets-for-simulation-or-player-tracking-data-analysis","status":"publish","type":"post","link":"https:\/\/optimumsportsperformance.com\/blog\/tidyx-episode-123-using-crossing-to-build-data-sets-for-simulation-or-player-tracking-data-analysis\/","title":{"rendered":"TidyX Episode 123: Using crossing to build data sets for simulation or player tracking data analysis"},"content":{"rendered":"<p>This week, <span style=\"color: #0000ff;\"><strong><a style=\"color: #0000ff;\" href=\"https:\/\/twitter.com\/ellis_hughes\">Ellis<\/a><\/strong><\/span> and I discuss the {<strong>tidyverse<\/strong>} function <strong>crossing()<\/strong> and show how it can be used to construct data sets of every possible combination of input variables (Cartesian product).<\/p>\n<p>This function is very powerful when attempting to create data sets, in particular for simulation purposes or for building a data set of all paired permutations of model input variables to test a model&#8217;s predictions and evaluate how it behaves under every circumstance.<\/p>\n<p>We end with a simple example of how to use <strong>crossing()<\/strong> and <strong>left_join()<\/strong> to build a data set for player tracking data that allows you to calculate the Euclidean distance between all players on the field\/pitch\/court\/ice.<\/p>\n<p>To watch our screen cast, <strong><span style=\"color: #0000ff;\"><a style=\"color: #0000ff;\" href=\"https:\/\/www.youtube.com\/watch?v=rtVpbedQ2Fw\">CLICK HERE.<\/a><\/span><\/strong><\/p>\n<p>To access our code, <span style=\"color: #0000ff;\"><strong><a style=\"color: #0000ff;\" href=\"https:\/\/github.com\/thebioengineer\/TidyX\/blob\/master\/TidyTuesday_Explained\/123-criss_cross_apple_sauce\/TidyX_Episode%20123.R\">CLICK HERE<\/a><\/strong><\/span>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This week, Ellis and I discuss the {tidyverse} function crossing() and show how it can be used to construct data sets of every possible combination of input variables (Cartesian product). This function is very powerful when attempting to create data sets, in particular for simulation purposes or for building a data set of all paired [&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-2689","post","type-post","status-publish","format-standard","hentry","category-tidyx-screen-cast"],"_links":{"self":[{"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/posts\/2689","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=2689"}],"version-history":[{"count":4,"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/posts\/2689\/revisions"}],"predecessor-version":[{"id":2693,"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/posts\/2689\/revisions\/2693"}],"wp:attachment":[{"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/media?parent=2689"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/categories?post=2689"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/tags?post=2689"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}