{"id":958,"date":"2023-07-28T04:38:06","date_gmt":"2023-07-28T04:38:06","guid":{"rendered":"https:\/\/statorials.org\/my\/conditional-mutation-r\/"},"modified":"2023-07-28T04:38:06","modified_gmt":"2023-07-28T04:38:06","slug":"conditional-mutation-r","status":"publish","type":"post","link":"https:\/\/statorials.org\/my\/conditional-mutation-r\/","title":{"rendered":"Mutate() \u1014\u103e\u1004\u1037\u103a case_when() \u1016\u103c\u1004\u1037\u103a r \u1010\u103d\u1004\u103a variable \u1021\u101e\u1005\u103a\u1019\u103b\u102c\u1038\u1000\u102d\u102f\u1016\u1014\u103a\u1010\u102e\u1038\u1015\u102b\u104b"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">\u1019\u1000\u103c\u102c\u1001\u100f\u1006\u102d\u102f\u101e\u101c\u102d\u102f \u101e\u1004\u103a\u101e\u100a\u103a \u1021\u1001\u103b\u102d\u102f\u1037\u101e\u1031\u102c\u1021\u1001\u103c\u1031\u1021\u1014\u1031\u1019\u103b\u102c\u1038\u1021\u1015\u1031\u102b\u103a\u1021\u1001\u103c\u1031\u1001\u1036\u104d R \u101b\u103e\u102d \u1012\u1031\u1010\u102c\u1018\u1031\u102c\u1004\u103a\u1010\u1005\u103a\u1001\u102f\u1010\u103d\u1004\u103a \u1000\u102d\u1014\u103a\u1038\u101b\u103e\u1004\u103a\u1021\u101e\u1005\u103a\u1010\u1005\u103a\u1001\u102f\u1000\u102d\u102f \u1016\u1014\u103a\u1010\u102e\u1038\u101c\u102d\u102f\u1015\u1031\u1019\u100a\u103a\u104b \u1000\u1036\u1000\u1031\u102c\u1004\u103a\u1038\u1011\u1031\u102c\u1000\u103a\u1019\u1005\u103d\u102c\u104a \u104e\u1004\u103a\u1038\u101e\u100a\u103a <a href=\"https:\/\/dplyr.tidyverse.org\/index.html\" target=\"_blank\" rel=\"noopener noreferrer\">dplyr<\/a> package \u1019\u103e <strong>mutate()<\/strong> \u1014\u103e\u1004\u1037\u103a <strong>case_when()<\/strong> \u101c\u102f\u1015\u103a\u1006\u1031\u102c\u1004\u103a\u1001\u103b\u1000\u103a\u1019\u103b\u102c\u1038\u1000\u102d\u102f \u1021\u101e\u102f\u1036\u1038\u1015\u103c\u102f\u104d \u101c\u102f\u1015\u103a\u1006\u1031\u102c\u1004\u103a\u101b\u1014\u103a \u101c\u103d\u101a\u103a\u1000\u1030\u101e\u100a\u103a\u104b<\/span><\/p>\n<p> <span style=\"color: #000000;\">\u1024\u101e\u1004\u103a\u1001\u1014\u103a\u1038\u1005\u102c\u1010\u103d\u1004\u103a \u1021\u1031\u102c\u1000\u103a\u1015\u102b\u1012\u1031\u1010\u102c\u1018\u1031\u102c\u1004\u103a\u1016\u103c\u1004\u1037\u103a \u1024\u101c\u102f\u1015\u103a\u1006\u1031\u102c\u1004\u103a\u1001\u103b\u1000\u103a\u1019\u103b\u102c\u1038\u1000\u102d\u102f \u1021\u101e\u102f\u1036\u1038\u1015\u103c\u102f\u1001\u103c\u1004\u103a\u1038\u104f\u1014\u1019\u1030\u1014\u102c\u1019\u103b\u102c\u1038\u1005\u103d\u102c\u1000\u102d\u102f \u1015\u103c\u101e\u101e\u100a\u103a-<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#create data frame<\/span>\ndf &lt;- data.frame(player = c('a', 'b', 'c', 'd', 'e'),\n                 position = c('G', 'F', 'F', 'G', 'G'),\n                 points = c(12, 15, 19, 22, 32),\n                 rebounds = c(5, 7, 7, 12, 11))\n\n<span style=\"color: #008080;\">#view data frame\n<\/span>df\n\n  player position points rebounds\n1 to G 12 5\n2 b F 15 7\n3 c F 19 7\n4 d G 22 12\n5th G 32 11\n<\/strong><\/pre>\n<h3> <strong>\u1025\u1015\u1019\u102c 1- \u101b\u103e\u102d\u1015\u103c\u102e\u1038\u101e\u102c\u1038 variable \u1000\u102d\u102f\u1021\u1001\u103c\u1031\u1001\u1036\u104d variable \u1021\u101e\u1005\u103a\u1010\u1005\u103a\u1001\u102f\u1016\u1014\u103a\u1010\u102e\u1038\u1015\u102b\u104b<\/strong><\/h3>\n<p> <span style=\"color: #000000;\">\u1021\u1031\u102c\u1000\u103a\u1015\u102b \u1000\u102f\u1012\u103a\u101e\u100a\u103a \u1021\u1019\u103e\u1010\u103a\u1019\u103b\u102c\u1038 \u1000\u1031\u102c\u103a\u101c\u1036\u101b\u103e\u102d \u1010\u1014\u103a\u1016\u102d\u102f\u1038\u1021\u1015\u1031\u102b\u103a \u1021\u1001\u103c\u1031\u1001\u1036\u104d &#8220; scorer&#8221;  \u101f\u102f\u1001\u1031\u102b\u103a\u101e\u1031\u102c \u1000\u102d\u1014\u103a\u1038\u101b\u103e\u1004\u103a\u1021\u101e\u1005\u103a\u1000\u102d\u102f \u1016\u1014\u103a\u1010\u102e\u1038\u1014\u100a\u103a\u1038\u1000\u102d\u102f \u1015\u103c\u101e\u101e\u100a\u103a-<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong>library(dplyr)\n\n<span style=\"color: #008080;\">#define new variable 'scorer' using mutate() and case_when()\n<\/span>df %&gt;%\n  <span style=\"color: #3366ff;\">mutate<\/span> (scorer = <span style=\"color: #3366ff;\">case_when<\/span> (points &lt; 15 ~ ' <span style=\"color: #008000;\">low<\/span> ',\n                           points &lt; 25 ~ ' <span style=\"color: #008000;\">med<\/span> ',\n                           points &lt; 35 ~ ' <span style=\"color: #008000;\">high<\/span> '))\n\n  player position points rebounds scorer\n1 a G 12 5 low\n2 b F 15 7 med\n3 c F 19 7 med\n4 d G 22 12 med\n5th G 32 11 high<\/strong><\/pre>\n<h3> <strong>\u1025\u1015\u1019\u102c 2- \u101b\u103e\u102d\u1015\u103c\u102e\u1038\u101e\u102c\u1038 \u1000\u102d\u1014\u103a\u1038\u101b\u103e\u1004\u103a\u1019\u103b\u102c\u1038\u1005\u103d\u102c\u1000\u102d\u102f \u1021\u1001\u103c\u1031\u1001\u1036\u104d \u1000\u102d\u1014\u103a\u1038\u101b\u103e\u1004\u103a\u1021\u101e\u1005\u103a\u1010\u1005\u103a\u1001\u102f \u1016\u1014\u103a\u1010\u102e\u1038\u1015\u102b\u104b<\/strong><\/h3>\n<p> <span style=\"color: #000000;\">\u1021\u1031\u102c\u1000\u103a\u1015\u102b\u1000\u102f\u1012\u103a\u101e\u100a\u103a \u1015\u101c\u1031\u101a\u102c\u1014\u103e\u1004\u1037\u103a \u101b\u102c\u1011\u1030\u1038\u1000\u1031\u102c\u103a\u101c\u1036\u101b\u103e\u102d \u1010\u1014\u103a\u1016\u102d\u102f\u1038\u1021\u1015\u1031\u102b\u103a \u1021\u1001\u103c\u1031\u1001\u1036\u104d &#8220; \u1021\u1019\u103b\u102d\u102f\u1038\u1021\u1005\u102c\u1038&#8221;  \u101f\u102f\u1001\u1031\u102b\u103a\u101e\u1031\u102c \u1000\u102d\u1014\u103a\u1038\u101b\u103e\u1004\u103a\u1021\u101e\u1005\u103a\u1000\u102d\u102f \u1016\u1014\u103a\u1010\u102e\u1038\u1014\u100a\u103a\u1038\u1000\u102d\u102f \u1015\u103c\u101e\u101e\u100a\u103a-<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong>library(dplyr)\n\n<span style=\"color: #008080;\">#define new variable 'type' using mutate() and case_when()\n<\/span>df %&gt;%\n  <span style=\"color: #3366ff;\">mutate<\/span> (type = <span style=\"color: #3366ff;\">case_when<\/span> (player == 'a' | player == 'b' ~ ' <span style=\"color: #008000;\">starter<\/span> ',\n                            player == 'c' | player == 'd' ~ ' <span style=\"color: #008000;\">backup<\/span> ',\n                            position == 'G' ~ ' <span style=\"color: #008000;\">reserve<\/span> '))\n\n  player position points rebounds type\n1 a G 12 5 starter\n2 b F 15 7 starter\n3 c F 19 7 backup\n4 d G 22 12 backup\n5th G 32 11 reserve<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">\u1021\u1031\u102c\u1000\u103a\u1016\u1031\u102c\u103a\u1015\u103c\u1015\u102b \u1000\u102f\u1012\u103a\u101e\u100a\u103a \u1021\u1019\u103e\u1010\u103a\u1019\u103b\u102c\u1038\u104f\u1010\u1014\u103a\u1016\u102d\u102f\u1038\u1014\u103e\u1004\u1037\u103a \u1000\u1031\u102c\u103a\u101c\u1036\u1019\u103b\u102c\u1038\u1000\u102d\u102f \u1015\u103c\u1014\u103a\u101c\u103e\u1014\u103a\u101e\u100a\u1037\u103a\u1010\u1014\u103a\u1016\u102d\u102f\u1038\u1021\u1015\u1031\u102b\u103a \u1021\u1001\u103c\u1031\u1001\u1036\u104d &#8220; valueAdded&#8221;  \u101f\u102f\u1001\u1031\u102b\u103a\u101e\u1031\u102c \u1000\u102d\u1014\u103a\u1038\u101b\u103e\u1004\u103a\u1021\u101e\u1005\u103a\u1000\u102d\u102f \u1019\u100a\u103a\u101e\u102d\u102f\u1037\u1016\u1014\u103a\u1010\u102e\u1038\u101b\u1019\u100a\u103a\u1000\u102d\u102f \u1015\u103c\u101e\u101e\u100a\u103a-<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong>library(dplyr)\n\n<span style=\"color: #008080;\">#define new variable 'valueAdded' using mutate() and case_when()\n<\/span>df %&gt;%\n  <span style=\"color: #3366ff;\">mutate<\/span> (valueAdded = <span style=\"color: #3366ff;\">case_when<\/span> (points &lt;= 15 &amp; rebounds &lt;=5 ~ 2,\n                                points &lt;=15 &amp; rebounds &gt; 5 ~ 4,\n                                points &lt; 25 &amp; rebounds &lt; 8 ~ 6,\n                                points &lt; 25 &amp; rebounds &gt; 8 ~ 7,\n                                points &gt;=25 ~ 9))\n\n  player position points rebounds valueAdded\n1 to G 12 5 2\n2 b F 15 7 4\n3c F 19 7 6\n4 d G 22 12 7\n5th G 32 11 9<\/strong><\/pre>\n<h3> <span style=\"color: #000000;\"><strong>\u1011\u1015\u103a\u101c\u1031\u102c\u1004\u103a\u1038\u1021\u101b\u1004\u103a\u1038\u1021\u1019\u103c\u1005\u103a\u1019\u103b\u102c\u1038<\/strong><\/span><\/h3>\n<p> <a href=\"https:\/\/statorials.org\" target=\"_blank\" rel=\"noopener noreferrer\">R \u1010\u103d\u1004\u103a \u1000\u1031\u102c\u103a\u101c\u1036\u1021\u1019\u100a\u103a\u1015\u103c\u1031\u102c\u1004\u103a\u1038\u1014\u100a\u103a\u1038<\/a><br \/> <a href=\"https:\/\/statorials.org\/my\/r-\u1010\u103d\u1004\u103a\u1000\u1031\u102c\u103a\u101c\u1036\u1019\u103b\u102c\u1038\u1000\u102d\u102f\u1016\u101a\u103a\u101b\u103e\u102c\u1038\u1015\u102b\u104b\/\" target=\"_blank\" rel=\"noopener noreferrer\">R \u1010\u103d\u1004\u103a\u1000\u1031\u102c\u103a\u101c\u1036\u1019\u103b\u102c\u1038\u1000\u102d\u102f\u1019\u100a\u103a\u101e\u102d\u102f\u1037\u1016\u103b\u1000\u103a\u1019\u100a\u103a\u1014\u100a\u103a\u1038\u104b<\/a><br \/> <a href=\"https:\/\/statorials.org\/my\/filter-\u1021\u1010\u1014\u103a\u1038-r\/\" target=\"_blank\" rel=\"noopener noreferrer\">R \u1010\u103d\u1004\u103a \u1021\u1010\u1014\u103a\u1038\u1019\u103b\u102c\u1038\u1000\u102d\u102f \u1005\u1005\u103a\u1011\u102f\u1010\u103a\u1014\u100a\u103a\u1038<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u1019\u1000\u103c\u102c\u1001\u100f\u1006\u102d\u102f\u101e\u101c\u102d\u102f \u101e\u1004\u103a\u101e\u100a\u103a \u1021\u1001\u103b\u102d\u102f\u1037\u101e\u1031\u102c\u1021\u1001\u103c\u1031\u1021\u1014\u1031\u1019\u103b\u102c\u1038\u1021\u1015\u1031\u102b\u103a\u1021\u1001\u103c\u1031\u1001\u1036\u104d R \u101b\u103e\u102d \u1012\u1031\u1010\u102c\u1018\u1031\u102c\u1004\u103a\u1010\u1005\u103a\u1001\u102f\u1010\u103d\u1004\u103a \u1000\u102d\u1014\u103a\u1038\u101b\u103e\u1004\u103a\u1021\u101e\u1005\u103a\u1010\u1005\u103a\u1001\u102f\u1000\u102d\u102f \u1016\u1014\u103a\u1010\u102e\u1038\u101c\u102d\u102f\u1015\u1031\u1019\u100a\u103a\u104b \u1000\u1036\u1000\u1031\u102c\u1004\u103a\u1038\u1011\u1031\u102c\u1000\u103a\u1019\u1005\u103d\u102c\u104a \u104e\u1004\u103a\u1038\u101e\u100a\u103a dplyr package \u1019\u103e mutate() \u1014\u103e\u1004\u1037\u103a case_when() \u101c\u102f\u1015\u103a\u1006\u1031\u102c\u1004\u103a\u1001\u103b\u1000\u103a\u1019\u103b\u102c\u1038\u1000\u102d\u102f \u1021\u101e\u102f\u1036\u1038\u1015\u103c\u102f\u104d \u101c\u102f\u1015\u103a\u1006\u1031\u102c\u1004\u103a\u101b\u1014\u103a \u101c\u103d\u101a\u103a\u1000\u1030\u101e\u100a\u103a\u104b \u1024\u101e\u1004\u103a\u1001\u1014\u103a\u1038\u1005\u102c\u1010\u103d\u1004\u103a \u1021\u1031\u102c\u1000\u103a\u1015\u102b\u1012\u1031\u1010\u102c\u1018\u1031\u102c\u1004\u103a\u1016\u103c\u1004\u1037\u103a \u1024\u101c\u102f\u1015\u103a\u1006\u1031\u102c\u1004\u103a\u1001\u103b\u1000\u103a\u1019\u103b\u102c\u1038\u1000\u102d\u102f \u1021\u101e\u102f\u1036\u1038\u1015\u103c\u102f\u1001\u103c\u1004\u103a\u1038\u104f\u1014\u1019\u1030\u1014\u102c\u1019\u103b\u102c\u1038\u1005\u103d\u102c\u1000\u102d\u102f \u1015\u103c\u101e\u101e\u100a\u103a- #create data frame df &lt;- data.frame(player = c(&#8216;a&#8217;, &#8216;b&#8217;, &#8216;c&#8217;, &#8216;d&#8217;, &#8216;e&#8217;), position = c(&#8216;G&#8217;, &#8216;F&#8217;, &#8216;F&#8217;, &#8216;G&#8217;, &#8216;G&#8217;), points = c(12, 15, 19, 22, 32), rebounds = c(5, 7, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>mutate() \u1014\u103e\u1004\u1037\u103a case_when() \u1016\u103c\u1004\u1037\u103a R \u1010\u103d\u1004\u103a variable \u1021\u101e\u1005\u103a\u1019\u103b\u102c\u1038\u1000\u102d\u102f\u1016\u1014\u103a\u1010\u102e\u1038\u1015\u102b\u104b<\/title>\n<meta name=\"description\" content=\"mutate() \u1014\u103e\u1004\u1037\u103a case_when() \u101c\u102f\u1015\u103a\u1006\u1031\u102c\u1004\u103a\u1001\u103b\u1000\u103a\u1019\u103b\u102c\u1038\u1000\u102d\u102f \u1021\u101e\u102f\u1036\u1038\u1015\u103c\u102f\u104d R \u1010\u103d\u1004\u103a \u1000\u102d\u1014\u103a\u1038\u101b\u103e\u1004\u103a\u1021\u101e\u1005\u103a\u1019\u103b\u102c\u1038 \u1016\u1014\u103a\u1010\u102e\u1038\u1014\u100a\u103a\u1038 \u101b\u102d\u102f\u1038\u101b\u103e\u1004\u103a\u1038\u101e\u1031\u102c \u101b\u103e\u1004\u103a\u1038\u101c\u1004\u103a\u1038\u1001\u103b\u1000\u103a\u104b\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/statorials.org\/my\/conditional-mutation-r\/\" \/>\n<meta property=\"og:locale\" content=\"my_MM\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"mutate() \u1014\u103e\u1004\u1037\u103a case_when() \u1016\u103c\u1004\u1037\u103a R \u1010\u103d\u1004\u103a variable \u1021\u101e\u1005\u103a\u1019\u103b\u102c\u1038\u1000\u102d\u102f\u1016\u1014\u103a\u1010\u102e\u1038\u1015\u102b\u104b\" \/>\n<meta property=\"og:description\" content=\"mutate() \u1014\u103e\u1004\u1037\u103a case_when() \u101c\u102f\u1015\u103a\u1006\u1031\u102c\u1004\u103a\u1001\u103b\u1000\u103a\u1019\u103b\u102c\u1038\u1000\u102d\u102f \u1021\u101e\u102f\u1036\u1038\u1015\u103c\u102f\u104d R \u1010\u103d\u1004\u103a \u1000\u102d\u1014\u103a\u1038\u101b\u103e\u1004\u103a\u1021\u101e\u1005\u103a\u1019\u103b\u102c\u1038 \u1016\u1014\u103a\u1010\u102e\u1038\u1014\u100a\u103a\u1038 \u101b\u102d\u102f\u1038\u101b\u103e\u1004\u103a\u1038\u101e\u1031\u102c \u101b\u103e\u1004\u103a\u1038\u101c\u1004\u103a\u1038\u1001\u103b\u1000\u103a\u104b\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/my\/conditional-mutation-r\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-28T04:38:06+00:00\" \/>\n<meta name=\"author\" content=\"Benjamin Anderson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Benjamin Anderson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/statorials.org\/my\/conditional-mutation-r\/\",\"url\":\"https:\/\/statorials.org\/my\/conditional-mutation-r\/\",\"name\":\"mutate() \u1014\u103e\u1004\u1037\u103a case_when() \u1016\u103c\u1004\u1037\u103a R \u1010\u103d\u1004\u103a variable \u1021\u101e\u1005\u103a\u1019\u103b\u102c\u1038\u1000\u102d\u102f\u1016\u1014\u103a\u1010\u102e\u1038\u1015\u102b\u104b\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/my\/#website\"},\"datePublished\":\"2023-07-28T04:38:06+00:00\",\"dateModified\":\"2023-07-28T04:38:06+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/my\/#\/schema\/person\/e47470981684a202f7ed4c0cb1e10097\"},\"description\":\"mutate() \u1014\u103e\u1004\u1037\u103a case_when() \u101c\u102f\u1015\u103a\u1006\u1031\u102c\u1004\u103a\u1001\u103b\u1000\u103a\u1019\u103b\u102c\u1038\u1000\u102d\u102f \u1021\u101e\u102f\u1036\u1038\u1015\u103c\u102f\u104d R \u1010\u103d\u1004\u103a \u1000\u102d\u1014\u103a\u1038\u101b\u103e\u1004\u103a\u1021\u101e\u1005\u103a\u1019\u103b\u102c\u1038 \u1016\u1014\u103a\u1010\u102e\u1038\u1014\u100a\u103a\u1038 \u101b\u102d\u102f\u1038\u101b\u103e\u1004\u103a\u1038\u101e\u1031\u102c \u101b\u103e\u1004\u103a\u1038\u101c\u1004\u103a\u1038\u1001\u103b\u1000\u103a\u104b\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/my\/conditional-mutation-r\/#breadcrumb\"},\"inLanguage\":\"my-MM\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/my\/conditional-mutation-r\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/my\/conditional-mutation-r\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u1021\u102d\u1019\u103a\",\"item\":\"https:\/\/statorials.org\/my\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Mutate() \u1014\u103e\u1004\u1037\u103a case_when() \u1016\u103c\u1004\u1037\u103a r \u1010\u103d\u1004\u103a variable \u1021\u101e\u1005\u103a\u1019\u103b\u102c\u1038\u1000\u102d\u102f\u1016\u1014\u103a\u1010\u102e\u1038\u1015\u102b\u104b\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/statorials.org\/my\/#website\",\"url\":\"https:\/\/statorials.org\/my\/\",\"name\":\"Statorials\",\"description\":\"\u1005\u102c\u101b\u1004\u103a\u1038\u1021\u1004\u103a\u1038\u1006\u102d\u102f\u1004\u103a\u101b\u102c \u1021\u101b\u100a\u103a\u1021\u1001\u103b\u1004\u103a\u1038\u1021\u1010\u103d\u1000\u103a \u101e\u1004\u1037\u103a\u101c\u1019\u103a\u1038\u100a\u103d\u103e\u1014\u103a\u1001\u103b\u1000\u103a\u104b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/statorials.org\/my\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"my-MM\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/statorials.org\/my\/#\/schema\/person\/e47470981684a202f7ed4c0cb1e10097\",\"name\":\"Benjamin Anderson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"my-MM\",\"@id\":\"https:\/\/statorials.org\/my\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/statorials.org\/my\/wp-content\/uploads\/2023\/11\/Benjamin-Anderson-96x96.jpg\",\"contentUrl\":\"https:\/\/statorials.org\/my\/wp-content\/uploads\/2023\/11\/Benjamin-Anderson-96x96.jpg\",\"caption\":\"Benjamin Anderson\"},\"description\":\"\u1019\u1004\u103a\u1039\u1002\u101c\u102c\u1015\u102b\u104a \u1000\u103b\u103d\u1014\u103a\u102f\u1015\u103a\u101e\u100a\u103a \u1021\u1004\u103c\u102d\u1019\u103a\u1038\u1005\u102c\u1038 \u1005\u102c\u101b\u1004\u103a\u1038\u1021\u1004\u103a\u1038 \u1015\u102b\u1019\u1031\u102c\u1000\u1039\u1001 \u1018\u1004\u103a\u1002\u103b\u1019\u1004\u103a\u1016\u103c\u1005\u103a\u1015\u103c\u102e\u1038 \u101e\u102e\u1038\u101e\u1014\u1037\u103a Statorials \u1006\u101b\u102c\u1021\u1016\u103c\u1005\u103a \u101c\u103e\u100a\u1037\u103a\u1015\u1010\u103a\u1015\u102b\u101e\u100a\u103a\u104b \u1005\u102c\u101b\u1004\u103a\u1038\u1007\u101a\u102c\u1038\u1014\u101a\u103a\u1015\u101a\u103a\u1010\u103d\u1004\u103a \u1000\u103b\u101a\u103a\u1015\u103c\u1014\u1037\u103a\u101e\u1031\u102c\u1021\u1010\u103d\u1031\u1037\u1021\u1000\u103c\u102f\u1036\u1014\u103e\u1004\u1037\u103a \u1000\u103b\u103d\u1019\u103a\u1038\u1000\u103b\u1004\u103a\u1019\u103e\u102f\u1014\u103e\u1004\u1037\u103a\u1021\u1010\u1030\u104a Statorials \u1019\u103e\u1010\u1005\u103a\u1006\u1004\u1037\u103a \u1000\u103b\u1031\u102c\u1004\u103a\u1038\u101e\u102c\u1038\u1019\u103b\u102c\u1038\u1000\u102d\u102f \u1001\u103d\u1014\u103a\u1021\u102c\u1038\u1016\u103c\u1005\u103a\u1005\u1031\u101b\u1014\u103a\u1021\u1010\u103d\u1000\u103a \u1000\u103b\u103d\u1014\u103a\u102f\u1015\u103a\u104f\u1021\u101e\u102d\u1015\u100a\u102c\u1000\u102d\u102f \u1019\u103b\u103e\u101d\u1031\u101c\u102d\u102f\u1015\u102b\u101e\u100a\u103a\u104b \u1015\u102d\u102f\u101e\u102d\u1010\u101a\u103a\u104b\",\"sameAs\":[\"https:\/\/statorials.org\/my\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"mutate() \u1014\u103e\u1004\u1037\u103a case_when() \u1016\u103c\u1004\u1037\u103a R \u1010\u103d\u1004\u103a variable \u1021\u101e\u1005\u103a\u1019\u103b\u102c\u1038\u1000\u102d\u102f\u1016\u1014\u103a\u1010\u102e\u1038\u1015\u102b\u104b","description":"mutate() \u1014\u103e\u1004\u1037\u103a case_when() \u101c\u102f\u1015\u103a\u1006\u1031\u102c\u1004\u103a\u1001\u103b\u1000\u103a\u1019\u103b\u102c\u1038\u1000\u102d\u102f \u1021\u101e\u102f\u1036\u1038\u1015\u103c\u102f\u104d R \u1010\u103d\u1004\u103a \u1000\u102d\u1014\u103a\u1038\u101b\u103e\u1004\u103a\u1021\u101e\u1005\u103a\u1019\u103b\u102c\u1038 \u1016\u1014\u103a\u1010\u102e\u1038\u1014\u100a\u103a\u1038 \u101b\u102d\u102f\u1038\u101b\u103e\u1004\u103a\u1038\u101e\u1031\u102c \u101b\u103e\u1004\u103a\u1038\u101c\u1004\u103a\u1038\u1001\u103b\u1000\u103a\u104b","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:\/\/statorials.org\/my\/conditional-mutation-r\/","og_locale":"my_MM","og_type":"article","og_title":"mutate() \u1014\u103e\u1004\u1037\u103a case_when() \u1016\u103c\u1004\u1037\u103a R \u1010\u103d\u1004\u103a variable \u1021\u101e\u1005\u103a\u1019\u103b\u102c\u1038\u1000\u102d\u102f\u1016\u1014\u103a\u1010\u102e\u1038\u1015\u102b\u104b","og_description":"mutate() \u1014\u103e\u1004\u1037\u103a case_when() \u101c\u102f\u1015\u103a\u1006\u1031\u102c\u1004\u103a\u1001\u103b\u1000\u103a\u1019\u103b\u102c\u1038\u1000\u102d\u102f \u1021\u101e\u102f\u1036\u1038\u1015\u103c\u102f\u104d R \u1010\u103d\u1004\u103a \u1000\u102d\u1014\u103a\u1038\u101b\u103e\u1004\u103a\u1021\u101e\u1005\u103a\u1019\u103b\u102c\u1038 \u1016\u1014\u103a\u1010\u102e\u1038\u1014\u100a\u103a\u1038 \u101b\u102d\u102f\u1038\u101b\u103e\u1004\u103a\u1038\u101e\u1031\u102c \u101b\u103e\u1004\u103a\u1038\u101c\u1004\u103a\u1038\u1001\u103b\u1000\u103a\u104b","og_url":"https:\/\/statorials.org\/my\/conditional-mutation-r\/","og_site_name":"Statorials","article_published_time":"2023-07-28T04:38:06+00:00","author":"Benjamin Anderson","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Benjamin Anderson","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/statorials.org\/my\/conditional-mutation-r\/","url":"https:\/\/statorials.org\/my\/conditional-mutation-r\/","name":"mutate() \u1014\u103e\u1004\u1037\u103a case_when() \u1016\u103c\u1004\u1037\u103a R \u1010\u103d\u1004\u103a variable \u1021\u101e\u1005\u103a\u1019\u103b\u102c\u1038\u1000\u102d\u102f\u1016\u1014\u103a\u1010\u102e\u1038\u1015\u102b\u104b","isPartOf":{"@id":"https:\/\/statorials.org\/my\/#website"},"datePublished":"2023-07-28T04:38:06+00:00","dateModified":"2023-07-28T04:38:06+00:00","author":{"@id":"https:\/\/statorials.org\/my\/#\/schema\/person\/e47470981684a202f7ed4c0cb1e10097"},"description":"mutate() \u1014\u103e\u1004\u1037\u103a case_when() \u101c\u102f\u1015\u103a\u1006\u1031\u102c\u1004\u103a\u1001\u103b\u1000\u103a\u1019\u103b\u102c\u1038\u1000\u102d\u102f \u1021\u101e\u102f\u1036\u1038\u1015\u103c\u102f\u104d R \u1010\u103d\u1004\u103a \u1000\u102d\u1014\u103a\u1038\u101b\u103e\u1004\u103a\u1021\u101e\u1005\u103a\u1019\u103b\u102c\u1038 \u1016\u1014\u103a\u1010\u102e\u1038\u1014\u100a\u103a\u1038 \u101b\u102d\u102f\u1038\u101b\u103e\u1004\u103a\u1038\u101e\u1031\u102c \u101b\u103e\u1004\u103a\u1038\u101c\u1004\u103a\u1038\u1001\u103b\u1000\u103a\u104b","breadcrumb":{"@id":"https:\/\/statorials.org\/my\/conditional-mutation-r\/#breadcrumb"},"inLanguage":"my-MM","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/my\/conditional-mutation-r\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/my\/conditional-mutation-r\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u1021\u102d\u1019\u103a","item":"https:\/\/statorials.org\/my\/"},{"@type":"ListItem","position":2,"name":"Mutate() \u1014\u103e\u1004\u1037\u103a case_when() \u1016\u103c\u1004\u1037\u103a r \u1010\u103d\u1004\u103a variable \u1021\u101e\u1005\u103a\u1019\u103b\u102c\u1038\u1000\u102d\u102f\u1016\u1014\u103a\u1010\u102e\u1038\u1015\u102b\u104b"}]},{"@type":"WebSite","@id":"https:\/\/statorials.org\/my\/#website","url":"https:\/\/statorials.org\/my\/","name":"Statorials","description":"\u1005\u102c\u101b\u1004\u103a\u1038\u1021\u1004\u103a\u1038\u1006\u102d\u102f\u1004\u103a\u101b\u102c \u1021\u101b\u100a\u103a\u1021\u1001\u103b\u1004\u103a\u1038\u1021\u1010\u103d\u1000\u103a \u101e\u1004\u1037\u103a\u101c\u1019\u103a\u1038\u100a\u103d\u103e\u1014\u103a\u1001\u103b\u1000\u103a\u104b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/statorials.org\/my\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"my-MM"},{"@type":"Person","@id":"https:\/\/statorials.org\/my\/#\/schema\/person\/e47470981684a202f7ed4c0cb1e10097","name":"Benjamin Anderson","image":{"@type":"ImageObject","inLanguage":"my-MM","@id":"https:\/\/statorials.org\/my\/#\/schema\/person\/image\/","url":"https:\/\/statorials.org\/my\/wp-content\/uploads\/2023\/11\/Benjamin-Anderson-96x96.jpg","contentUrl":"https:\/\/statorials.org\/my\/wp-content\/uploads\/2023\/11\/Benjamin-Anderson-96x96.jpg","caption":"Benjamin Anderson"},"description":"\u1019\u1004\u103a\u1039\u1002\u101c\u102c\u1015\u102b\u104a \u1000\u103b\u103d\u1014\u103a\u102f\u1015\u103a\u101e\u100a\u103a \u1021\u1004\u103c\u102d\u1019\u103a\u1038\u1005\u102c\u1038 \u1005\u102c\u101b\u1004\u103a\u1038\u1021\u1004\u103a\u1038 \u1015\u102b\u1019\u1031\u102c\u1000\u1039\u1001 \u1018\u1004\u103a\u1002\u103b\u1019\u1004\u103a\u1016\u103c\u1005\u103a\u1015\u103c\u102e\u1038 \u101e\u102e\u1038\u101e\u1014\u1037\u103a Statorials \u1006\u101b\u102c\u1021\u1016\u103c\u1005\u103a \u101c\u103e\u100a\u1037\u103a\u1015\u1010\u103a\u1015\u102b\u101e\u100a\u103a\u104b \u1005\u102c\u101b\u1004\u103a\u1038\u1007\u101a\u102c\u1038\u1014\u101a\u103a\u1015\u101a\u103a\u1010\u103d\u1004\u103a \u1000\u103b\u101a\u103a\u1015\u103c\u1014\u1037\u103a\u101e\u1031\u102c\u1021\u1010\u103d\u1031\u1037\u1021\u1000\u103c\u102f\u1036\u1014\u103e\u1004\u1037\u103a \u1000\u103b\u103d\u1019\u103a\u1038\u1000\u103b\u1004\u103a\u1019\u103e\u102f\u1014\u103e\u1004\u1037\u103a\u1021\u1010\u1030\u104a Statorials \u1019\u103e\u1010\u1005\u103a\u1006\u1004\u1037\u103a \u1000\u103b\u1031\u102c\u1004\u103a\u1038\u101e\u102c\u1038\u1019\u103b\u102c\u1038\u1000\u102d\u102f \u1001\u103d\u1014\u103a\u1021\u102c\u1038\u1016\u103c\u1005\u103a\u1005\u1031\u101b\u1014\u103a\u1021\u1010\u103d\u1000\u103a \u1000\u103b\u103d\u1014\u103a\u102f\u1015\u103a\u104f\u1021\u101e\u102d\u1015\u100a\u102c\u1000\u102d\u102f \u1019\u103b\u103e\u101d\u1031\u101c\u102d\u102f\u1015\u102b\u101e\u100a\u103a\u104b \u1015\u102d\u102f\u101e\u102d\u1010\u101a\u103a\u104b","sameAs":["https:\/\/statorials.org\/my"]}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"_links":{"self":[{"href":"https:\/\/statorials.org\/my\/wp-json\/wp\/v2\/posts\/958"}],"collection":[{"href":"https:\/\/statorials.org\/my\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/statorials.org\/my\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/statorials.org\/my\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/statorials.org\/my\/wp-json\/wp\/v2\/comments?post=958"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/my\/wp-json\/wp\/v2\/posts\/958\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/my\/wp-json\/wp\/v2\/media?parent=958"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/my\/wp-json\/wp\/v2\/categories?post=958"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/my\/wp-json\/wp\/v2\/tags?post=958"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}