{"id":2695,"date":"2022-11-13T20:24:48","date_gmt":"2022-11-13T20:24:48","guid":{"rendered":"http:\/\/optimumsportsperformance.com\/blog\/?p=2695"},"modified":"2022-11-14T14:06:01","modified_gmt":"2022-11-14T14:06:01","slug":"tidyx-episode-124-combining-multiple-conditions-in-a-single-column","status":"publish","type":"post","link":"https:\/\/optimumsportsperformance.com\/blog\/tidyx-episode-124-combining-multiple-conditions-in-a-single-column\/","title":{"rendered":"TidyX Episode 124: Combining Multiple Conditions in a Single Column"},"content":{"rendered":"<p>Some of the best TidyX episodes are born out of questions from viewers or colleagues. This week, <strong><span style=\"color: #0000ff;\"><a style=\"color: #0000ff;\" href=\"https:\/\/twitter.com\/ellis_hughes\">Ellis Hughes<\/a><\/span><\/strong> and I dip into the mailbag and answer a question from a colleague about identifying multiple conditions.<\/p>\n<p>The colleague that had a data set with specific observations in one column. Their goal was to create a new column which put those observations into one of several conditional groups. The issue they were running into was that <strong>case_when()<\/strong> and <strong>ifelse()<\/strong> only output the first condition that is met. The colleague was looking for a way to append the conditional groups column with a comma separate string, so that some of the observations could match multiple conditional groups.<\/p>\n<p>In this episode, we solve the problem in three different ways.<\/p>\n<p>To watch our screen cast, <strong><span style=\"color: #0000ff;\"><a style=\"color: #0000ff;\" href=\"https:\/\/www.youtube.com\/watch?v=3ooQee4HCro\">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\/blob\/master\/TidyTuesday_Explained\/124-Combining_Multiple_Conditions\/Multiple%20Conditions.R\">CLICK HERE<\/a><\/span><\/strong>.<\/p>\n<p><a href=\"https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2022\/11\/Screen-Shot-2022-11-14-at-6.05.13-AM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2698\" src=\"https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2022\/11\/Screen-Shot-2022-11-14-at-6.05.13-AM.png\" alt=\"\" width=\"289\" height=\"173\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Some of the best TidyX episodes are born out of questions from viewers or colleagues. This week, Ellis Hughes and I dip into the mailbag and answer a question from a colleague about identifying multiple conditions. The colleague that had a data set with specific observations in one column. Their goal was to create a [&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-2695","post","type-post","status-publish","format-standard","hentry","category-tidyx-screen-cast"],"_links":{"self":[{"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/posts\/2695","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=2695"}],"version-history":[{"count":3,"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/posts\/2695\/revisions"}],"predecessor-version":[{"id":2699,"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/posts\/2695\/revisions\/2699"}],"wp:attachment":[{"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/media?parent=2695"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/categories?post=2695"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/tags?post=2695"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}