{"id":467,"date":"2023-07-29T19:40:31","date_gmt":"2023-07-29T19:40:31","guid":{"rendered":"https:\/\/statorials.org\/th\/%e0%b8%84%e0%b8%b3%e0%b9%81%e0%b8%99%e0%b8%b0%e0%b8%99%e0%b8%b3%e0%b9%83%e0%b8%99%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b9%83%e0%b8%8a%e0%b9%89-lapply-sapply-%e0%b9%81%e0%b8%a5%e0%b8%b0-tapply-%e0%b9%83\/"},"modified":"2023-07-29T19:40:31","modified_gmt":"2023-07-29T19:40:31","slug":"%e0%b8%84%e0%b8%b3%e0%b9%81%e0%b8%99%e0%b8%b0%e0%b8%99%e0%b8%b3%e0%b9%83%e0%b8%99%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b9%83%e0%b8%8a%e0%b9%89-lapply-sapply-%e0%b9%81%e0%b8%a5%e0%b8%b0-tapply-%e0%b9%83","status":"publish","type":"post","link":"https:\/\/statorials.org\/th\/%e0%b8%84%e0%b8%b3%e0%b9%81%e0%b8%99%e0%b8%b0%e0%b8%99%e0%b8%b3%e0%b9%83%e0%b8%99%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b9%83%e0%b8%8a%e0%b9%89-lapply-sapply-%e0%b9%81%e0%b8%a5%e0%b8%b0-tapply-%e0%b9%83\/","title":{"rendered":"\u0e04\u0e33\u0e41\u0e19\u0e30\u0e19\u0e33\u0e43\u0e19\u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49(), lapply(), sapply() \u0e41\u0e25\u0e30 tapply() \u0e43\u0e19 r"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">\u0e1a\u0e17\u0e0a\u0e48\u0e27\u0e22\u0e2a\u0e2d\u0e19\u0e19\u0e35\u0e49\u0e08\u0e30\u0e2d\u0e18\u0e34\u0e1a\u0e32\u0e22\u0e04\u0e27\u0e32\u0e21\u0e41\u0e15\u0e01\u0e15\u0e48\u0e32\u0e07\u0e23\u0e30\u0e2b\u0e27\u0e48\u0e32\u0e07\u0e1f\u0e31\u0e07\u0e01\u0e4c\u0e0a\u0e31\u0e19 R \u0e43\u0e19\u0e15\u0e31\u0e27 <strong>Apply()<\/strong> , <strong>sapply()<\/strong> , <strong>lapply()<\/strong> \u0e41\u0e25\u0e30 <strong>tapply()<\/strong> \u0e1e\u0e23\u0e49\u0e2d\u0e21\u0e14\u0e49\u0e27\u0e22\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e27\u0e48\u0e32\u0e08\u0e30\u0e43\u0e0a\u0e49\u0e41\u0e15\u0e48\u0e25\u0e30\u0e1f\u0e31\u0e07\u0e01\u0e4c\u0e0a\u0e31\u0e19\u0e40\u0e21\u0e37\u0e48\u0e2d\u0e43\u0e14\u0e41\u0e25\u0e30\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e44\u0e23<\/span><\/p>\n<h2> <span style=\"color: #000000;\"><strong>\u0e19\u0e33\u0e21\u0e32\u0e43\u0e0a\u0e49()<\/strong><\/span><\/h2>\n<p> <span style=\"color: #000000;\">\u0e43\u0e0a\u0e49\u0e1f\u0e31\u0e07\u0e01\u0e4c\u0e0a\u0e31\u0e19 <strong>Apply()<\/strong> \u0e40\u0e21\u0e37\u0e48\u0e2d\u0e04\u0e38\u0e13\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49\u0e1f\u0e31\u0e07\u0e01\u0e4c\u0e0a\u0e31\u0e19\u0e01\u0e31\u0e1a\u0e41\u0e16\u0e27\u0e2b\u0e23\u0e37\u0e2d\u0e04\u0e2d\u0e25\u0e31\u0e21\u0e19\u0e4c\u0e02\u0e2d\u0e07\u0e40\u0e21\u0e17\u0e23\u0e34\u0e01\u0e0b\u0e4c\u0e2b\u0e23\u0e37\u0e2d\u0e01\u0e23\u0e2d\u0e1a\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25<\/span><\/p>\n<p> <span style=\"color: #000000;\">\u0e44\u0e27\u0e22\u0e32\u0e01\u0e23\u0e13\u0e4c\u0e1e\u0e37\u0e49\u0e19\u0e10\u0e32\u0e19\u0e02\u0e2d\u0e07\u0e1f\u0e31\u0e07\u0e01\u0e4c\u0e0a\u0e31\u0e19 Apply() \u0e04\u0e37\u0e2d:<\/span><\/p>\n<p style=\"text-align: center;\"> <span style=\"color: #000000;\"><strong>\u0e43\u0e0a\u0e49 (X, \u0e21\u0e32\u0e23\u0e4c\u0e08\u0e34\u0e49\u0e19, \u0e2a\u0e19\u0e38\u0e01)<\/strong><\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\">X \u0e04\u0e37\u0e2d\u0e0a\u0e37\u0e48\u0e2d\u0e02\u0e2d\u0e07\u0e2d\u0e32\u0e23\u0e4c\u0e40\u0e23\u0e22\u0e4c\u0e2b\u0e23\u0e37\u0e2d\u0e1a\u0e25\u0e47\u0e2d\u0e01\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25<\/span><\/li>\n<li> <span style=\"color: #000000;\">MARGIN \u0e1a\u0e48\u0e07\u0e0a\u0e35\u0e49\u0e27\u0e48\u0e32\u0e21\u0e34\u0e15\u0e34\u0e43\u0e14\u0e17\u0e35\u0e48\u0e08\u0e30\u0e14\u0e33\u0e40\u0e19\u0e34\u0e19\u0e01\u0e32\u0e23 (1 = \u0e41\u0e16\u0e27, 2 = \u0e04\u0e2d\u0e25\u0e31\u0e21\u0e19\u0e4c)<\/span><\/li>\n<li> <span style=\"color: #000000;\">FUN \u0e04\u0e37\u0e2d\u0e01\u0e32\u0e23\u0e14\u0e33\u0e40\u0e19\u0e34\u0e19\u0e01\u0e32\u0e23\u0e40\u0e09\u0e1e\u0e32\u0e30\u0e17\u0e35\u0e48\u0e04\u0e38\u0e13\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e14\u0e33\u0e40\u0e19\u0e34\u0e19\u0e01\u0e32\u0e23 (\u0e40\u0e0a\u0e48\u0e19 \u0e15\u0e48\u0e33\u0e2a\u0e38\u0e14 \u0e2a\u0e39\u0e07\u0e2a\u0e38\u0e14 \u0e1c\u0e25\u0e23\u0e27\u0e21 \u0e04\u0e48\u0e32\u0e40\u0e09\u0e25\u0e35\u0e48\u0e22 \u0e2f\u0e25\u0e2f)<\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\">\u0e42\u0e04\u0e49\u0e14\u0e15\u0e48\u0e2d\u0e44\u0e1b\u0e19\u0e35\u0e49\u0e41\u0e2a\u0e14\u0e07\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19\u0e08\u0e23\u0e34\u0e07\u0e02\u0e2d\u0e07 <strong>Apply()<\/strong> \u0e2b\u0e25\u0e32\u0e22\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07<\/span><\/p>\n<pre style=\"background-color: #e5e5e5; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#create a data frame with three columns and five rows<\/span>\ndata &lt;- data.frame(a = c(1, 3, 7, 12, 9),\n                   b = c(4, 4, 6, 7, 8),\n                   c = c(14, 15, 11, 10, 6))\ndata\n\n#abc\n#1 1 4 14\n#2 3 4 15\n#3 7 6 11\n#4 12 7 10\n#5 9 8 6\n\n<span style=\"color: #008080;\">#find the sum of each row<\/span>\napply(data, 1, sum)\n\n#[1] 19 22 24 29 23\n\n<span style=\"color: #008080;\">#find the sum of each column<\/span>\napply(data, 2, sum)\n\n#abc\n#32 29 56 \n\n<span style=\"color: #008080;\">#find the mean of each row<\/span>\napply(data, 1, mean)\n\n#[1] 6.333333 7.333333 8.000000 9.666667 7.666667\n\n<span style=\"color: #008080;\">#find the mean of each column, rounded to one decimal place<\/span>\nround(apply(data, 2, mean), 1)\n\n#abc\n#6.4 5.8 11.2 \n\n<span style=\"color: #008080;\">#find the standard deviation of each row<\/span>\napply(data, 1, sd)\n\n#[1] 6.806859 6.658328 2.645751 2.516611 1.527525\n\n<span style=\"color: #008080;\">#find the standard deviation of each column<\/span>\napply(data, 2, sd)\n\n#abc\n#4.449719 1.788854 3.563706 \n<\/strong><\/pre>\n<h2> <span style=\"color: #000000;\"><strong>\u0e19\u0e33\u0e21\u0e32\u0e43\u0e0a\u0e49()<\/strong><\/span><\/h2>\n<p> <span style=\"color: #000000;\">\u0e43\u0e0a\u0e49\u0e1f\u0e31\u0e07\u0e01\u0e4c\u0e0a\u0e31\u0e19 <strong>lapply()<\/strong> \u0e40\u0e21\u0e37\u0e48\u0e2d\u0e04\u0e38\u0e13\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49\u0e1f\u0e31\u0e07\u0e01\u0e4c\u0e0a\u0e31\u0e19\u0e01\u0e31\u0e1a\u0e41\u0e15\u0e48\u0e25\u0e30\u0e2d\u0e07\u0e04\u0e4c\u0e1b\u0e23\u0e30\u0e01\u0e2d\u0e1a\u0e02\u0e2d\u0e07\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23 \u0e40\u0e27\u0e01\u0e40\u0e15\u0e2d\u0e23\u0e4c \u0e2b\u0e23\u0e37\u0e2d\u0e01\u0e23\u0e2d\u0e1a\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25 \u0e41\u0e25\u0e30\u0e23\u0e31\u0e1a\u0e1c\u0e25\u0e25\u0e31\u0e1e\u0e18\u0e4c\u0e40\u0e1b\u0e47\u0e19\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23<\/span><\/p>\n<p> <span style=\"color: #000000;\">\u0e44\u0e27\u0e22\u0e32\u0e01\u0e23\u0e13\u0e4c\u0e1e\u0e37\u0e49\u0e19\u0e10\u0e32\u0e19\u0e02\u0e2d\u0e07\u0e1f\u0e31\u0e07\u0e01\u0e4c\u0e0a\u0e31\u0e19 lapply() \u0e04\u0e37\u0e2d:<\/span><\/p>\n<p style=\"text-align: center;\"> <span style=\"color: #000000;\"><strong>\u0e04\u0e48\u0e2d\u0e22\u0e40\u0e1b\u0e47\u0e19\u0e04\u0e48\u0e2d\u0e22\u0e44\u0e1b(X, FUN)<\/strong><\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\">X \u0e04\u0e37\u0e2d\u0e0a\u0e37\u0e48\u0e2d\u0e02\u0e2d\u0e07\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23 \u0e40\u0e27\u0e01\u0e40\u0e15\u0e2d\u0e23\u0e4c \u0e2b\u0e23\u0e37\u0e2d\u0e01\u0e23\u0e2d\u0e1a\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25<\/span><\/li>\n<li> <span style=\"color: #000000;\">FUN \u0e04\u0e37\u0e2d\u0e01\u0e32\u0e23\u0e14\u0e33\u0e40\u0e19\u0e34\u0e19\u0e01\u0e32\u0e23\u0e40\u0e09\u0e1e\u0e32\u0e30\u0e17\u0e35\u0e48\u0e04\u0e38\u0e13\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e14\u0e33\u0e40\u0e19\u0e34\u0e19\u0e01\u0e32\u0e23<\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\">\u0e23\u0e2b\u0e31\u0e2a\u0e15\u0e48\u0e2d\u0e44\u0e1b\u0e19\u0e35\u0e49\u0e2a\u0e32\u0e18\u0e34\u0e15\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e15\u0e48\u0e32\u0e07\u0e46 \u0e02\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49 <strong>lapply()<\/strong> \u0e01\u0e31\u0e1a\u0e04\u0e2d\u0e25\u0e31\u0e21\u0e19\u0e4c\u0e43\u0e19\u0e01\u0e23\u0e2d\u0e1a\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25<\/span><\/p>\n<pre style=\"background-color: #e5e5e5; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#create a data frame with three columns and five rows\n<\/span>data &lt;- data.frame(a = c(1, 3, 7, 12, 9),\n                   b = c(4, 4, 6, 7, 8),\n                   c = c(14, 15, 11, 10, 6))\ndata\n\n#abc\n#1 1 4 14\n#2 3 4 15\n#3 7 6 11\n#4 12 7 10\n#5 9 8 6\n\n<span style=\"color: #008080;\">#find mean of each column and return results as a list<\/span>\napply(data, mean)\n\n#$a\n# [1] 6.4\n#\n# $b\n# [1] 5.8\n#\n# $c\n# [1] 11.2\n\n<span style=\"color: #008080;\">#multiply values in each column by 2 and return results as a list<\/span>\nlapply(data, function(data) data*2)\n\n#$a\n# [1] 2 6 14 24 18\n#\n# $b\n# [1] 8 8 12 14 16\n#\n# $c\n# [1] 28 30 22 20 12\n<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">\u0e40\u0e23\u0e32\u0e22\u0e31\u0e07\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e43\u0e0a\u0e49 <strong>lapply()<\/strong> \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e14\u0e33\u0e40\u0e19\u0e34\u0e19\u0e01\u0e32\u0e23\u0e01\u0e31\u0e1a\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23\u0e15\u0e48\u0e32\u0e07\u0e46 \u0e44\u0e14\u0e49 \u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e15\u0e48\u0e2d\u0e44\u0e1b\u0e19\u0e35\u0e49\u0e41\u0e2a\u0e14\u0e07\u0e27\u0e34\u0e18\u0e35\u0e01\u0e32\u0e23\u0e17\u0e33\u0e40\u0e0a\u0e48\u0e19\u0e19\u0e35\u0e49<\/span><\/p>\n<pre style=\"background-color: #e5e5e5; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#create a list\n<\/span>x &lt;- list(a=1, b=1:5, c=1:10) \nx\n\n#$a\n# [1] 1\n#\n# $b\n# [1] 1 2 3 4 5\n#\n# $c\n# [1] 1 2 3 4 5 6 7 8 9 10\n\n<span style=\"color: #008080;\">#find the sum of each element in the list<\/span>\nlapply(x, sum)\n\n#$a\n# [1] 1\n#\n# $b\n# [1] 15\n#\n# $c\n#[1]55\n\n<span style=\"color: #008080;\">#find the mean of each element in the list<\/span>\nlapply(x, mean)\n\n#$a\n# [1] 1\n#\n# $b\n# [1] 3\n#\n# $c\n# [1] 5.5\n\n<span style=\"color: #008080;\">#multiply values of each element by 5 and return results as a list<\/span>\nlapply(x, function(x) x*5)\n\n#$a\n# [1] 5\n#\n# $b\n# [1] 5 10 15 20 25\n#\n# $c\n# [1] 5 10 15 20 25 30 35 40 45 50\n<\/strong><\/pre>\n<h2> <span style=\"color: #000000;\"><strong>\u0e19\u0e33\u0e21\u0e32\u0e43\u0e0a\u0e49()<\/strong><\/span><\/h2>\n<p> <span style=\"color: #000000;\">\u0e43\u0e0a\u0e49\u0e1f\u0e31\u0e07\u0e01\u0e4c\u0e0a\u0e31\u0e19 <strong>sapply()<\/strong> \u0e40\u0e21\u0e37\u0e48\u0e2d\u0e04\u0e38\u0e13\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49\u0e1f\u0e31\u0e07\u0e01\u0e4c\u0e0a\u0e31\u0e19\u0e01\u0e31\u0e1a\u0e41\u0e15\u0e48\u0e25\u0e30\u0e2d\u0e07\u0e04\u0e4c\u0e1b\u0e23\u0e30\u0e01\u0e2d\u0e1a\u0e02\u0e2d\u0e07\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23 \u0e40\u0e27\u0e01\u0e40\u0e15\u0e2d\u0e23\u0e4c \u0e2b\u0e23\u0e37\u0e2d\u0e01\u0e23\u0e2d\u0e1a\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25 \u0e14\u0e31\u0e07\u0e19\u0e31\u0e49\u0e19\u0e08\u0e36\u0e07\u0e44\u0e14\u0e49\u0e23\u0e31\u0e1a <strong>\u0e40\u0e27\u0e01\u0e40\u0e15\u0e2d\u0e23\u0e4c<\/strong> \u0e41\u0e17\u0e19\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23<\/span><\/p>\n<p> <span style=\"color: #000000;\">\u0e44\u0e27\u0e22\u0e32\u0e01\u0e23\u0e13\u0e4c\u0e1e\u0e37\u0e49\u0e19\u0e10\u0e32\u0e19\u0e02\u0e2d\u0e07\u0e1f\u0e31\u0e07\u0e01\u0e4c\u0e0a\u0e31\u0e19 sapply() \u0e04\u0e37\u0e2d:<\/span><\/p>\n<p style=\"text-align: center;\"> <span style=\"color: #000000;\"><strong>\u0e2a\u0e21\u0e31\u0e04\u0e23 (X, \u0e2a\u0e19\u0e38\u0e01)<\/strong><\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\">X \u0e04\u0e37\u0e2d\u0e0a\u0e37\u0e48\u0e2d\u0e02\u0e2d\u0e07\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23 \u0e40\u0e27\u0e01\u0e40\u0e15\u0e2d\u0e23\u0e4c \u0e2b\u0e23\u0e37\u0e2d\u0e01\u0e23\u0e2d\u0e1a\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25<\/span><\/li>\n<li> <span style=\"color: #000000;\">FUN \u0e04\u0e37\u0e2d\u0e01\u0e32\u0e23\u0e14\u0e33\u0e40\u0e19\u0e34\u0e19\u0e01\u0e32\u0e23\u0e40\u0e09\u0e1e\u0e32\u0e30\u0e17\u0e35\u0e48\u0e04\u0e38\u0e13\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e14\u0e33\u0e40\u0e19\u0e34\u0e19\u0e01\u0e32\u0e23<\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\">\u0e42\u0e04\u0e49\u0e14\u0e15\u0e48\u0e2d\u0e44\u0e1b\u0e19\u0e35\u0e49\u0e2a\u0e32\u0e18\u0e34\u0e15\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49 <strong>sapply()<\/strong> \u0e01\u0e31\u0e1a\u0e04\u0e2d\u0e25\u0e31\u0e21\u0e19\u0e4c\u0e43\u0e19 data frame<\/span><\/p>\n<pre style=\"background-color: #e5e5e5; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#create a data frame with three columns and five rows\n<\/span>data &lt;- data.frame(a = c(1, 3, 7, 12, 9),\n                   b = c(4, 4, 6, 7, 8),\n                   c = c(14, 15, 11, 10, 6))\ndata\n\n#abc\n#1 1 4 14\n#2 3 4 15\n#3 7 6 11\n#4 12 7 10\n#5 9 8 6\n\n<span style=\"color: #008080;\">#find mean of each column and return results as a vector\n<\/span>sapply(data, mean)\n\n#abc\n#6.4 5.8 11.2 \n\n<span style=\"color: #008080;\">#multiply values in each column by 2 and return results as a matrix\n<\/span>sapply(data, function(data) data*2)\n\n#abc\n#[1,] 2 8 28\n#[2,] 6 8 30\n#[3,] 14 12 22\n#[4,] 24 14 20\n#[5,] 18 16 12<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">\u0e40\u0e23\u0e32\u0e22\u0e31\u0e07\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e43\u0e0a\u0e49 <strong>sapply()<\/strong> \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e14\u0e33\u0e40\u0e19\u0e34\u0e19\u0e01\u0e32\u0e23\u0e01\u0e31\u0e1a\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23\u0e15\u0e48\u0e32\u0e07\u0e46 \u0e44\u0e14\u0e49 \u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e15\u0e48\u0e2d\u0e44\u0e1b\u0e19\u0e35\u0e49\u0e41\u0e2a\u0e14\u0e07\u0e27\u0e34\u0e18\u0e35\u0e01\u0e32\u0e23\u0e17\u0e33\u0e40\u0e0a\u0e48\u0e19\u0e19\u0e35\u0e49<\/span><\/p>\n<pre style=\"background-color: #e5e5e5; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#create a list\n<\/span>x &lt;- list(a=1, b=1:5, c=1:10) \nx\n\n#$a\n# [1] 1\n#\n# $b\n# [1] 1 2 3 4 5\n#\n# $c\n# [1] 1 2 3 4 5 6 7 8 9 10\n\n<span style=\"color: #008080;\">#find the sum of each element in the list<\/span>\nsapply(x, sum)\n\n#abc\n#1 15 55 \n\n<span style=\"color: #008080;\">#find the mean of each element in the list<\/span>\nsapply(x, mean)\n\n#abc\n#1.0 3.0 5.5\n<\/strong><\/pre>\n<h2> <span style=\"color: #000000;\"><strong>\u0e41\u0e15\u0e30()<\/strong><\/span><\/h2>\n<p> <span style=\"color: #000000;\">\u0e43\u0e0a\u0e49\u0e1f\u0e31\u0e07\u0e01\u0e4c\u0e0a\u0e31\u0e19 <strong>tapply()<\/strong> \u0e40\u0e21\u0e37\u0e48\u0e2d\u0e04\u0e38\u0e13\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49\u0e1f\u0e31\u0e07\u0e01\u0e4c\u0e0a\u0e31\u0e19\u0e01\u0e31\u0e1a\u0e0a\u0e38\u0e14\u0e22\u0e48\u0e2d\u0e22\u0e02\u0e2d\u0e07\u0e40\u0e27\u0e01\u0e40\u0e15\u0e2d\u0e23\u0e4c \u0e41\u0e25\u0e30\u0e0a\u0e38\u0e14\u0e22\u0e48\u0e2d\u0e22\u0e16\u0e39\u0e01\u0e01\u0e33\u0e2b\u0e19\u0e14\u0e42\u0e14\u0e22\u0e40\u0e27\u0e01\u0e40\u0e15\u0e2d\u0e23\u0e4c\u0e2d\u0e37\u0e48\u0e19 \u0e0b\u0e36\u0e48\u0e07\u0e42\u0e14\u0e22\u0e1b\u0e01\u0e15\u0e34\u0e08\u0e30\u0e40\u0e1b\u0e47\u0e19\u0e1b\u0e31\u0e08\u0e08\u0e31\u0e22<\/span><\/p>\n<p> <span style=\"color: #000000;\">\u0e44\u0e27\u0e22\u0e32\u0e01\u0e23\u0e13\u0e4c\u0e1e\u0e37\u0e49\u0e19\u0e10\u0e32\u0e19\u0e02\u0e2d\u0e07\u0e1f\u0e31\u0e07\u0e01\u0e4c\u0e0a\u0e31\u0e19 tapply() \u0e04\u0e37\u0e2d:<\/span><\/p>\n<p style=\"text-align: center;\"> <span style=\"color: #000000;\"><strong>\u0e41\u0e15\u0e30(X, \u0e14\u0e31\u0e0a\u0e19\u0e35, \u0e2a\u0e19\u0e38\u0e01)<\/strong><\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\">X \u0e04\u0e37\u0e2d\u0e0a\u0e37\u0e48\u0e2d\u0e02\u0e2d\u0e07\u0e27\u0e31\u0e15\u0e16\u0e38 \u0e0b\u0e36\u0e48\u0e07\u0e42\u0e14\u0e22\u0e1b\u0e01\u0e15\u0e34\u0e08\u0e30\u0e40\u0e1b\u0e47\u0e19\u0e40\u0e27\u0e01\u0e40\u0e15\u0e2d\u0e23\u0e4c<\/span><\/li>\n<li> <span style=\"color: #000000;\">INDEX \u0e04\u0e37\u0e2d\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23\u0e02\u0e2d\u0e07\u0e1b\u0e31\u0e08\u0e08\u0e31\u0e22\u0e15\u0e31\u0e49\u0e07\u0e41\u0e15\u0e48\u0e2b\u0e19\u0e36\u0e48\u0e07\u0e15\u0e31\u0e27\u0e02\u0e36\u0e49\u0e19\u0e44\u0e1b<\/span><\/li>\n<li> <span style=\"color: #000000;\">FUN \u0e04\u0e37\u0e2d\u0e01\u0e32\u0e23\u0e14\u0e33\u0e40\u0e19\u0e34\u0e19\u0e01\u0e32\u0e23\u0e40\u0e09\u0e1e\u0e32\u0e30\u0e17\u0e35\u0e48\u0e04\u0e38\u0e13\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e14\u0e33\u0e40\u0e19\u0e34\u0e19\u0e01\u0e32\u0e23<\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\">\u0e42\u0e04\u0e49\u0e14\u0e15\u0e48\u0e2d\u0e44\u0e1b\u0e19\u0e35\u0e49\u0e41\u0e2a\u0e14\u0e07\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49 <strong>tapply()<\/strong> \u0e1a\u0e19 <strong><em>\u0e0a\u0e38\u0e14<\/em> \u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25 R \u0e17\u0e35\u0e48\u0e1d\u0e31\u0e07\u0e14\u0e49\u0e27\u0e22\u0e21\u0e48\u0e32\u0e19\u0e15\u0e32<\/strong><\/span><\/p>\n<pre style=\"background-color: #e5e5e5; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#view first six lines of <em>iris<\/em> dataset<\/span>\nhead(iris)\n\n# Sepal.Length Sepal.Width Petal.Length Petal.Width Species\n#1 5.1 3.5 1.4 0.2 setosa\n#2 4.9 3.0 1.4 0.2 setosa\n#3 4.7 3.2 1.3 0.2 setosa\n#4 4.6 3.1 1.5 0.2 setosa\n#5 5.0 3.6 1.4 0.2 setosa\n#6 5.4 3.9 1.7 0.4 setosa\n\n<span style=\"color: #008080;\">#find the max Sepal.Length of each of the three Species<\/span>\ntapply(iris$Sepal.Length, iris$Species, max)\n\n#setosa versicolor virginica \n#5.8 7.0 7.9 \n\n<span style=\"color: #008080;\">#find the mean Sepal.Width of each of the three Species\n<\/span>tapply(iris$Sepal.Width, iris$Species, mean)\n\n# setosa versicolor virginica \n# 3,428 2,770 2,974\n\n<span style=\"color: #008080;\">#find the minimum Petal.Width of each of the three Species\n<\/span>tapply(iris$Petal.Width, iris$Species, min)\n\n# setosa versicolor virginica \n#0.1 1.0 1.4 \n<\/strong><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u0e1a\u0e17\u0e0a\u0e48\u0e27\u0e22\u0e2a\u0e2d\u0e19\u0e19\u0e35\u0e49\u0e08\u0e30\u0e2d\u0e18\u0e34\u0e1a\u0e32\u0e22\u0e04\u0e27\u0e32\u0e21\u0e41\u0e15\u0e01\u0e15\u0e48\u0e32\u0e07\u0e23\u0e30\u0e2b\u0e27\u0e48\u0e32\u0e07\u0e1f\u0e31\u0e07\u0e01\u0e4c\u0e0a\u0e31\u0e19 R \u0e43\u0e19\u0e15\u0e31\u0e27  [&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":[],"class_list":["post-467","post","type-post","status-publish","format-standard","hentry","category-3"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u0e04\u0e33\u0e41\u0e19\u0e30\u0e19\u0e33\u0e43\u0e19\u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49 (), lapply (), sapply () \u0e41\u0e25\u0e30 tapply () \u0e43\u0e19 R - Statorials<\/title>\n<meta name=\"description\" content=\"\u0e1a\u0e17\u0e0a\u0e48\u0e27\u0e22\u0e2a\u0e2d\u0e19\u0e19\u0e35\u0e49\u0e08\u0e30\u0e2d\u0e18\u0e34\u0e1a\u0e32\u0e22\u0e04\u0e27\u0e32\u0e21\u0e41\u0e15\u0e01\u0e15\u0e48\u0e32\u0e07\u0e23\u0e30\u0e2b\u0e27\u0e48\u0e32\u0e07\u0e1f\u0e31\u0e07\u0e01\u0e4c\u0e0a\u0e31\u0e19 R \u0e43\u0e19\u0e15\u0e31\u0e27 Apply(), sapply(), lapply() \u0e41\u0e25\u0e30 tapply() \u0e1e\u0e23\u0e49\u0e2d\u0e21\u0e14\u0e49\u0e27\u0e22\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19\" \/>\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\/th\/\u0e04\u0e33\u0e41\u0e19\u0e30\u0e19\u0e33\u0e43\u0e19\u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49-lapply-sapply-\u0e41\u0e25\u0e30-tapply-\u0e43\/\" \/>\n<meta property=\"og:locale\" content=\"th_TH\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u0e04\u0e33\u0e41\u0e19\u0e30\u0e19\u0e33\u0e43\u0e19\u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49 (), lapply (), sapply () \u0e41\u0e25\u0e30 tapply () \u0e43\u0e19 R - Statorials\" \/>\n<meta property=\"og:description\" content=\"\u0e1a\u0e17\u0e0a\u0e48\u0e27\u0e22\u0e2a\u0e2d\u0e19\u0e19\u0e35\u0e49\u0e08\u0e30\u0e2d\u0e18\u0e34\u0e1a\u0e32\u0e22\u0e04\u0e27\u0e32\u0e21\u0e41\u0e15\u0e01\u0e15\u0e48\u0e32\u0e07\u0e23\u0e30\u0e2b\u0e27\u0e48\u0e32\u0e07\u0e1f\u0e31\u0e07\u0e01\u0e4c\u0e0a\u0e31\u0e19 R \u0e43\u0e19\u0e15\u0e31\u0e27 Apply(), sapply(), lapply() \u0e41\u0e25\u0e30 tapply() \u0e1e\u0e23\u0e49\u0e2d\u0e21\u0e14\u0e49\u0e27\u0e22\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/th\/\u0e04\u0e33\u0e41\u0e19\u0e30\u0e19\u0e33\u0e43\u0e19\u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49-lapply-sapply-\u0e41\u0e25\u0e30-tapply-\u0e43\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-29T19:40:31+00:00\" \/>\n<meta name=\"author\" content=\"\u0e14\u0e23.\u0e40\u0e1a\u0e19\u0e08\u0e32\u0e21\u0e34\u0e19 \u0e41\u0e2d\u0e19\u0e40\u0e14\u0e2d\u0e23\u0e4c\u0e2a\u0e31\u0e19\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u0e14\u0e23.\u0e40\u0e1a\u0e19\u0e08\u0e32\u0e21\u0e34\u0e19 \u0e41\u0e2d\u0e19\u0e40\u0e14\u0e2d\u0e23\u0e4c\u0e2a\u0e31\u0e19\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u0e19\u0e32\u0e17\u0e35\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/statorials.org\/th\/%e0%b8%84%e0%b8%b3%e0%b9%81%e0%b8%99%e0%b8%b0%e0%b8%99%e0%b8%b3%e0%b9%83%e0%b8%99%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b9%83%e0%b8%8a%e0%b9%89-lapply-sapply-%e0%b9%81%e0%b8%a5%e0%b8%b0-tapply-%e0%b9%83\/\",\"url\":\"https:\/\/statorials.org\/th\/%e0%b8%84%e0%b8%b3%e0%b9%81%e0%b8%99%e0%b8%b0%e0%b8%99%e0%b8%b3%e0%b9%83%e0%b8%99%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b9%83%e0%b8%8a%e0%b9%89-lapply-sapply-%e0%b9%81%e0%b8%a5%e0%b8%b0-tapply-%e0%b9%83\/\",\"name\":\"\u0e04\u0e33\u0e41\u0e19\u0e30\u0e19\u0e33\u0e43\u0e19\u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49 (), lapply (), sapply () \u0e41\u0e25\u0e30 tapply () \u0e43\u0e19 R - Statorials\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/th\/#website\"},\"datePublished\":\"2023-07-29T19:40:31+00:00\",\"dateModified\":\"2023-07-29T19:40:31+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/th\/#\/schema\/person\/7c9bb3d0f799d0f1b17883495e1de332\"},\"description\":\"\u0e1a\u0e17\u0e0a\u0e48\u0e27\u0e22\u0e2a\u0e2d\u0e19\u0e19\u0e35\u0e49\u0e08\u0e30\u0e2d\u0e18\u0e34\u0e1a\u0e32\u0e22\u0e04\u0e27\u0e32\u0e21\u0e41\u0e15\u0e01\u0e15\u0e48\u0e32\u0e07\u0e23\u0e30\u0e2b\u0e27\u0e48\u0e32\u0e07\u0e1f\u0e31\u0e07\u0e01\u0e4c\u0e0a\u0e31\u0e19 R \u0e43\u0e19\u0e15\u0e31\u0e27 Apply(), sapply(), lapply() \u0e41\u0e25\u0e30 tapply() \u0e1e\u0e23\u0e49\u0e2d\u0e21\u0e14\u0e49\u0e27\u0e22\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/th\/%e0%b8%84%e0%b8%b3%e0%b9%81%e0%b8%99%e0%b8%b0%e0%b8%99%e0%b8%b3%e0%b9%83%e0%b8%99%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b9%83%e0%b8%8a%e0%b9%89-lapply-sapply-%e0%b9%81%e0%b8%a5%e0%b8%b0-tapply-%e0%b9%83\/#breadcrumb\"},\"inLanguage\":\"th\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/th\/%e0%b8%84%e0%b8%b3%e0%b9%81%e0%b8%99%e0%b8%b0%e0%b8%99%e0%b8%b3%e0%b9%83%e0%b8%99%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b9%83%e0%b8%8a%e0%b9%89-lapply-sapply-%e0%b9%81%e0%b8%a5%e0%b8%b0-tapply-%e0%b9%83\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/th\/%e0%b8%84%e0%b8%b3%e0%b9%81%e0%b8%99%e0%b8%b0%e0%b8%99%e0%b8%b3%e0%b9%83%e0%b8%99%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b9%83%e0%b8%8a%e0%b9%89-lapply-sapply-%e0%b9%81%e0%b8%a5%e0%b8%b0-tapply-%e0%b9%83\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u0e1a\u0e49\u0e32\u0e19\",\"item\":\"https:\/\/statorials.org\/th\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u0e04\u0e33\u0e41\u0e19\u0e30\u0e19\u0e33\u0e43\u0e19\u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49(), lapply(), sapply() \u0e41\u0e25\u0e30 tapply() \u0e43\u0e19 r\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/statorials.org\/th\/#website\",\"url\":\"https:\/\/statorials.org\/th\/\",\"name\":\"Statorials\",\"description\":\"\u0e04\u0e33\u0e41\u0e19\u0e30\u0e19\u0e33\u0e02\u0e2d\u0e07\u0e04\u0e38\u0e13\u0e40\u0e01\u0e35\u0e48\u0e22\u0e27\u0e01\u0e31\u0e1a\u0e04\u0e27\u0e32\u0e21\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e17\u0e32\u0e07\u0e2a\u0e16\u0e34\u0e15\u0e34!\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/statorials.org\/th\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"th\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/statorials.org\/th\/#\/schema\/person\/7c9bb3d0f799d0f1b17883495e1de332\",\"name\":\"\u0e14\u0e23.\u0e40\u0e1a\u0e19\u0e08\u0e32\u0e21\u0e34\u0e19 \u0e41\u0e2d\u0e19\u0e40\u0e14\u0e2d\u0e23\u0e4c\u0e2a\u0e31\u0e19\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"th\",\"@id\":\"https:\/\/statorials.org\/th\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/statorials.org\/th\/wp-content\/uploads\/2023\/11\/Dr.-Benjamin-Anderson-96x96.jpg\",\"contentUrl\":\"https:\/\/statorials.org\/th\/wp-content\/uploads\/2023\/11\/Dr.-Benjamin-Anderson-96x96.jpg\",\"caption\":\"\u0e14\u0e23.\u0e40\u0e1a\u0e19\u0e08\u0e32\u0e21\u0e34\u0e19 \u0e41\u0e2d\u0e19\u0e40\u0e14\u0e2d\u0e23\u0e4c\u0e2a\u0e31\u0e19\"},\"description\":\"\u0e2a\u0e27\u0e31\u0e2a\u0e14\u0e35 \u0e09\u0e31\u0e19\u0e0a\u0e37\u0e48\u0e2d\u0e40\u0e1a\u0e19\u0e08\u0e32\u0e21\u0e34\u0e19 \u0e28\u0e32\u0e2a\u0e15\u0e23\u0e32\u0e08\u0e32\u0e23\u0e22\u0e4c\u0e2a\u0e16\u0e34\u0e15\u0e34\u0e40\u0e01\u0e29\u0e35\u0e22\u0e13\u0e2d\u0e32\u0e22\u0e38\u0e41\u0e25\u0e49\u0e27 \u0e41\u0e25\u0e30\u0e1c\u0e31\u0e19\u0e15\u0e31\u0e27\u0e21\u0e32\u0e40\u0e1b\u0e47\u0e19\u0e04\u0e23\u0e39\u0e2a\u0e2d\u0e19\u0e2a\u0e16\u0e34\u0e15\u0e34\u0e42\u0e14\u0e22\u0e40\u0e09\u0e1e\u0e32\u0e30 \u0e14\u0e49\u0e27\u0e22\u0e1b\u0e23\u0e30\u0e2a\u0e1a\u0e01\u0e32\u0e23\u0e13\u0e4c\u0e41\u0e25\u0e30\u0e04\u0e27\u0e32\u0e21\u0e40\u0e0a\u0e35\u0e48\u0e22\u0e27\u0e0a\u0e32\u0e0d\u0e17\u0e35\u0e48\u0e01\u0e27\u0e49\u0e32\u0e07\u0e02\u0e27\u0e32\u0e07\u0e43\u0e19\u0e2a\u0e32\u0e02\u0e32\u0e2a\u0e16\u0e34\u0e15\u0e34 \u0e09\u0e31\u0e19\u0e01\u0e23\u0e30\u0e15\u0e37\u0e2d\u0e23\u0e37\u0e2d\u0e23\u0e49\u0e19\u0e17\u0e35\u0e48\u0e08\u0e30\u0e41\u0e1a\u0e48\u0e07\u0e1b\u0e31\u0e19\u0e04\u0e27\u0e32\u0e21\u0e23\u0e39\u0e49\u0e02\u0e2d\u0e07\u0e09\u0e31\u0e19\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e40\u0e2a\u0e23\u0e34\u0e21\u0e28\u0e31\u0e01\u0e22\u0e20\u0e32\u0e1e\u0e19\u0e31\u0e01\u0e40\u0e23\u0e35\u0e22\u0e19\u0e1c\u0e48\u0e32\u0e19 Statorials. \u0e23\u0e39\u0e49\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e40\u0e15\u0e34\u0e21\",\"sameAs\":[\"https:\/\/statorials.org\/th\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u0e04\u0e33\u0e41\u0e19\u0e30\u0e19\u0e33\u0e43\u0e19\u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49 (), lapply (), sapply () \u0e41\u0e25\u0e30 tapply () \u0e43\u0e19 R - Statorials","description":"\u0e1a\u0e17\u0e0a\u0e48\u0e27\u0e22\u0e2a\u0e2d\u0e19\u0e19\u0e35\u0e49\u0e08\u0e30\u0e2d\u0e18\u0e34\u0e1a\u0e32\u0e22\u0e04\u0e27\u0e32\u0e21\u0e41\u0e15\u0e01\u0e15\u0e48\u0e32\u0e07\u0e23\u0e30\u0e2b\u0e27\u0e48\u0e32\u0e07\u0e1f\u0e31\u0e07\u0e01\u0e4c\u0e0a\u0e31\u0e19 R \u0e43\u0e19\u0e15\u0e31\u0e27 Apply(), sapply(), lapply() \u0e41\u0e25\u0e30 tapply() \u0e1e\u0e23\u0e49\u0e2d\u0e21\u0e14\u0e49\u0e27\u0e22\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19","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\/th\/\u0e04\u0e33\u0e41\u0e19\u0e30\u0e19\u0e33\u0e43\u0e19\u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49-lapply-sapply-\u0e41\u0e25\u0e30-tapply-\u0e43\/","og_locale":"th_TH","og_type":"article","og_title":"\u0e04\u0e33\u0e41\u0e19\u0e30\u0e19\u0e33\u0e43\u0e19\u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49 (), lapply (), sapply () \u0e41\u0e25\u0e30 tapply () \u0e43\u0e19 R - Statorials","og_description":"\u0e1a\u0e17\u0e0a\u0e48\u0e27\u0e22\u0e2a\u0e2d\u0e19\u0e19\u0e35\u0e49\u0e08\u0e30\u0e2d\u0e18\u0e34\u0e1a\u0e32\u0e22\u0e04\u0e27\u0e32\u0e21\u0e41\u0e15\u0e01\u0e15\u0e48\u0e32\u0e07\u0e23\u0e30\u0e2b\u0e27\u0e48\u0e32\u0e07\u0e1f\u0e31\u0e07\u0e01\u0e4c\u0e0a\u0e31\u0e19 R \u0e43\u0e19\u0e15\u0e31\u0e27 Apply(), sapply(), lapply() \u0e41\u0e25\u0e30 tapply() \u0e1e\u0e23\u0e49\u0e2d\u0e21\u0e14\u0e49\u0e27\u0e22\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19","og_url":"https:\/\/statorials.org\/th\/\u0e04\u0e33\u0e41\u0e19\u0e30\u0e19\u0e33\u0e43\u0e19\u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49-lapply-sapply-\u0e41\u0e25\u0e30-tapply-\u0e43\/","og_site_name":"Statorials","article_published_time":"2023-07-29T19:40:31+00:00","author":"\u0e14\u0e23.\u0e40\u0e1a\u0e19\u0e08\u0e32\u0e21\u0e34\u0e19 \u0e41\u0e2d\u0e19\u0e40\u0e14\u0e2d\u0e23\u0e4c\u0e2a\u0e31\u0e19","twitter_card":"summary_large_image","twitter_misc":{"Written by":"\u0e14\u0e23.\u0e40\u0e1a\u0e19\u0e08\u0e32\u0e21\u0e34\u0e19 \u0e41\u0e2d\u0e19\u0e40\u0e14\u0e2d\u0e23\u0e4c\u0e2a\u0e31\u0e19","Est. reading time":"2 \u0e19\u0e32\u0e17\u0e35"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/statorials.org\/th\/%e0%b8%84%e0%b8%b3%e0%b9%81%e0%b8%99%e0%b8%b0%e0%b8%99%e0%b8%b3%e0%b9%83%e0%b8%99%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b9%83%e0%b8%8a%e0%b9%89-lapply-sapply-%e0%b9%81%e0%b8%a5%e0%b8%b0-tapply-%e0%b9%83\/","url":"https:\/\/statorials.org\/th\/%e0%b8%84%e0%b8%b3%e0%b9%81%e0%b8%99%e0%b8%b0%e0%b8%99%e0%b8%b3%e0%b9%83%e0%b8%99%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b9%83%e0%b8%8a%e0%b9%89-lapply-sapply-%e0%b9%81%e0%b8%a5%e0%b8%b0-tapply-%e0%b9%83\/","name":"\u0e04\u0e33\u0e41\u0e19\u0e30\u0e19\u0e33\u0e43\u0e19\u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49 (), lapply (), sapply () \u0e41\u0e25\u0e30 tapply () \u0e43\u0e19 R - Statorials","isPartOf":{"@id":"https:\/\/statorials.org\/th\/#website"},"datePublished":"2023-07-29T19:40:31+00:00","dateModified":"2023-07-29T19:40:31+00:00","author":{"@id":"https:\/\/statorials.org\/th\/#\/schema\/person\/7c9bb3d0f799d0f1b17883495e1de332"},"description":"\u0e1a\u0e17\u0e0a\u0e48\u0e27\u0e22\u0e2a\u0e2d\u0e19\u0e19\u0e35\u0e49\u0e08\u0e30\u0e2d\u0e18\u0e34\u0e1a\u0e32\u0e22\u0e04\u0e27\u0e32\u0e21\u0e41\u0e15\u0e01\u0e15\u0e48\u0e32\u0e07\u0e23\u0e30\u0e2b\u0e27\u0e48\u0e32\u0e07\u0e1f\u0e31\u0e07\u0e01\u0e4c\u0e0a\u0e31\u0e19 R \u0e43\u0e19\u0e15\u0e31\u0e27 Apply(), sapply(), lapply() \u0e41\u0e25\u0e30 tapply() \u0e1e\u0e23\u0e49\u0e2d\u0e21\u0e14\u0e49\u0e27\u0e22\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19","breadcrumb":{"@id":"https:\/\/statorials.org\/th\/%e0%b8%84%e0%b8%b3%e0%b9%81%e0%b8%99%e0%b8%b0%e0%b8%99%e0%b8%b3%e0%b9%83%e0%b8%99%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b9%83%e0%b8%8a%e0%b9%89-lapply-sapply-%e0%b9%81%e0%b8%a5%e0%b8%b0-tapply-%e0%b9%83\/#breadcrumb"},"inLanguage":"th","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/th\/%e0%b8%84%e0%b8%b3%e0%b9%81%e0%b8%99%e0%b8%b0%e0%b8%99%e0%b8%b3%e0%b9%83%e0%b8%99%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b9%83%e0%b8%8a%e0%b9%89-lapply-sapply-%e0%b9%81%e0%b8%a5%e0%b8%b0-tapply-%e0%b9%83\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/th\/%e0%b8%84%e0%b8%b3%e0%b9%81%e0%b8%99%e0%b8%b0%e0%b8%99%e0%b8%b3%e0%b9%83%e0%b8%99%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b9%83%e0%b8%8a%e0%b9%89-lapply-sapply-%e0%b9%81%e0%b8%a5%e0%b8%b0-tapply-%e0%b9%83\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u0e1a\u0e49\u0e32\u0e19","item":"https:\/\/statorials.org\/th\/"},{"@type":"ListItem","position":2,"name":"\u0e04\u0e33\u0e41\u0e19\u0e30\u0e19\u0e33\u0e43\u0e19\u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49(), lapply(), sapply() \u0e41\u0e25\u0e30 tapply() \u0e43\u0e19 r"}]},{"@type":"WebSite","@id":"https:\/\/statorials.org\/th\/#website","url":"https:\/\/statorials.org\/th\/","name":"Statorials","description":"\u0e04\u0e33\u0e41\u0e19\u0e30\u0e19\u0e33\u0e02\u0e2d\u0e07\u0e04\u0e38\u0e13\u0e40\u0e01\u0e35\u0e48\u0e22\u0e27\u0e01\u0e31\u0e1a\u0e04\u0e27\u0e32\u0e21\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e17\u0e32\u0e07\u0e2a\u0e16\u0e34\u0e15\u0e34!","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/statorials.org\/th\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"th"},{"@type":"Person","@id":"https:\/\/statorials.org\/th\/#\/schema\/person\/7c9bb3d0f799d0f1b17883495e1de332","name":"\u0e14\u0e23.\u0e40\u0e1a\u0e19\u0e08\u0e32\u0e21\u0e34\u0e19 \u0e41\u0e2d\u0e19\u0e40\u0e14\u0e2d\u0e23\u0e4c\u0e2a\u0e31\u0e19","image":{"@type":"ImageObject","inLanguage":"th","@id":"https:\/\/statorials.org\/th\/#\/schema\/person\/image\/","url":"https:\/\/statorials.org\/th\/wp-content\/uploads\/2023\/11\/Dr.-Benjamin-Anderson-96x96.jpg","contentUrl":"https:\/\/statorials.org\/th\/wp-content\/uploads\/2023\/11\/Dr.-Benjamin-Anderson-96x96.jpg","caption":"\u0e14\u0e23.\u0e40\u0e1a\u0e19\u0e08\u0e32\u0e21\u0e34\u0e19 \u0e41\u0e2d\u0e19\u0e40\u0e14\u0e2d\u0e23\u0e4c\u0e2a\u0e31\u0e19"},"description":"\u0e2a\u0e27\u0e31\u0e2a\u0e14\u0e35 \u0e09\u0e31\u0e19\u0e0a\u0e37\u0e48\u0e2d\u0e40\u0e1a\u0e19\u0e08\u0e32\u0e21\u0e34\u0e19 \u0e28\u0e32\u0e2a\u0e15\u0e23\u0e32\u0e08\u0e32\u0e23\u0e22\u0e4c\u0e2a\u0e16\u0e34\u0e15\u0e34\u0e40\u0e01\u0e29\u0e35\u0e22\u0e13\u0e2d\u0e32\u0e22\u0e38\u0e41\u0e25\u0e49\u0e27 \u0e41\u0e25\u0e30\u0e1c\u0e31\u0e19\u0e15\u0e31\u0e27\u0e21\u0e32\u0e40\u0e1b\u0e47\u0e19\u0e04\u0e23\u0e39\u0e2a\u0e2d\u0e19\u0e2a\u0e16\u0e34\u0e15\u0e34\u0e42\u0e14\u0e22\u0e40\u0e09\u0e1e\u0e32\u0e30 \u0e14\u0e49\u0e27\u0e22\u0e1b\u0e23\u0e30\u0e2a\u0e1a\u0e01\u0e32\u0e23\u0e13\u0e4c\u0e41\u0e25\u0e30\u0e04\u0e27\u0e32\u0e21\u0e40\u0e0a\u0e35\u0e48\u0e22\u0e27\u0e0a\u0e32\u0e0d\u0e17\u0e35\u0e48\u0e01\u0e27\u0e49\u0e32\u0e07\u0e02\u0e27\u0e32\u0e07\u0e43\u0e19\u0e2a\u0e32\u0e02\u0e32\u0e2a\u0e16\u0e34\u0e15\u0e34 \u0e09\u0e31\u0e19\u0e01\u0e23\u0e30\u0e15\u0e37\u0e2d\u0e23\u0e37\u0e2d\u0e23\u0e49\u0e19\u0e17\u0e35\u0e48\u0e08\u0e30\u0e41\u0e1a\u0e48\u0e07\u0e1b\u0e31\u0e19\u0e04\u0e27\u0e32\u0e21\u0e23\u0e39\u0e49\u0e02\u0e2d\u0e07\u0e09\u0e31\u0e19\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e40\u0e2a\u0e23\u0e34\u0e21\u0e28\u0e31\u0e01\u0e22\u0e20\u0e32\u0e1e\u0e19\u0e31\u0e01\u0e40\u0e23\u0e35\u0e22\u0e19\u0e1c\u0e48\u0e32\u0e19 Statorials. \u0e23\u0e39\u0e49\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e40\u0e15\u0e34\u0e21","sameAs":["https:\/\/statorials.org\/th"]}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"_links":{"self":[{"href":"https:\/\/statorials.org\/th\/wp-json\/wp\/v2\/posts\/467","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/statorials.org\/th\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/statorials.org\/th\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/statorials.org\/th\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/statorials.org\/th\/wp-json\/wp\/v2\/comments?post=467"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/th\/wp-json\/wp\/v2\/posts\/467\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/th\/wp-json\/wp\/v2\/media?parent=467"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/th\/wp-json\/wp\/v2\/categories?post=467"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/th\/wp-json\/wp\/v2\/tags?post=467"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}