{"id":74950,"date":"2020-03-22T08:42:19","date_gmt":"2020-03-22T05:42:19","guid":{"rendered":"https:\/\/prohoster.info\/blog\/administrirovanie\/vokrug-data-table"},"modified":"2020-03-22T08:42:19","modified_gmt":"2020-03-22T05:42:19","slug":"vokrug-data-table","status":"publish","type":"post","link":"https:\/\/prohoster.info\/de\/blog\/administrirovanie\/vokrug-data-table","title":{"rendered":"Rund um data.table","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p>\u042d\u0442\u0430 \u0437\u0430\u043c\u0435\u0442\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430 \u0434\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0442\u0430\u0431\u043b\u0438\u0447\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f R \u2014 data.table, \u0438, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0434 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u044c \u0435\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043d\u0430 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445.<\/p>\n<p>\u0412\u0434\u043e\u0445\u043d\u043e\u0432\u0438\u0432\u0448\u0438\u0441\u044c \u0445\u043e\u0440\u043e\u0448\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c <noindex><a rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/475210\/\">\u043a\u043e\u043b\u043b\u0435\u0433\u0438<\/a><\/noindex>, \u0438 \u043d\u0430\u0434\u0435\u044f\u0441\u044c, \u0447\u0442\u043e \u0432\u044b \u0443\u0436\u0435 \u043f\u043e\u0447\u0438\u0442\u0430\u043b\u0438 \u0435\u0433\u043e \u0441\u0442\u0430\u0442\u044c\u044e, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0433\u043b\u0443\u0431\u0436\u0435 \u043a\u043e\u043f\u043d\u0443\u0442\u044c \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430 \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 <b>data.table<\/b>.<br \/>\n<noindex><a rel=\"nofollow\" name=\"habracut\"><\/a><\/noindex><\/p>\n<h2>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435: \u043e\u0442\u043a\u0443\u0434\u0430 \u0438\u0434\u0435\u0442 data.table?<\/h2>\n<p>\n\u041b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u043d\u0430\u0447\u0430\u0442\u044c \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0438\u0437\u0434\u0430\u043b\u0435\u043a\u0430, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e, \u0441\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0434\u0430\u043d\u043d\u044b\u0445, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d \u043e\u0431\u044a\u0435\u043a\u0442 data.table (\u0434\u0430\u043b\u0435\u0435, \u0414\u0422).<\/p>\n<h3>\u041c\u0430\u0441\u0441\u0438\u0432<\/h3>\n<p>\n<b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<pre><code class=\"python\">## arrays ---------\n\narrmatr &lt;- array(1:20, c(4,5))\n\nclass(arrmatr)\n\ntypeof(arrmatr)\n\nis.array(arrmatr)\n\nis.matrix(arrmatr)\n\n<\/code><\/pre>\n<p>\u041e\u0434\u043d\u0430 \u0438\u0437 \u0442\u0430\u043a\u0438\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u2014 \u044d\u0442\u043e \u043c\u0430\u0441\u0441\u0438\u0432 (<b>?base::array<\/b>). \u041a\u0430\u043a \u0438 \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u044f\u0437\u044b\u043a\u0430\u0445 \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u0437\u0434\u0435\u0441\u044c \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b. \u041e\u0434\u043d\u0430\u043a\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u043e, \u0447\u0442\u043e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043e\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 \u043c\u0430\u0442\u0440\u0438\u0446\u044b<b> (?base::matrix<\/b>), \u0430 \u043e\u0434\u043d\u043e\u043c\u0435\u0440\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432, \u0447\u0442\u043e \u0442\u043e\u0436\u0435 \u0432\u0430\u0436\u043d\u043e, \u043d\u0435 \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043e\u0442 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 (<b>?base::vector<\/b>).<\/p>\n<p>\u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0430\u0434\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u0447\u0442\u043e \u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0445\u0441\u044f \u0432 \u043a\u0430\u043a\u043e\u043c-\u043b\u0438\u0431\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 <b>base::typeof<\/b>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e <b>R Internals<\/b> \u2014 \u043e\u0431\u0449\u0438\u043c \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u043c \u044f\u0437\u044b\u043a\u0430, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u043c \u0441 \u043f\u0435\u0440\u0432\u043e\u0440\u043e\u0434\u043d\u044b\u043c <b>C<\/b>.<\/p>\n<p>\u0415\u0449\u0435 \u043e\u0434\u043d\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430, \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043a\u043b\u0430\u0441\u0441\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u0430, <b>base::class<\/b>, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u0439 \u0442\u0438\u043f (\u043e\u043d \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c \u043e\u0442 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0433\u043e, \u043d\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043d\u044f\u0442\u044c \u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445).<\/p>\n<h3>\u0421\u043f\u0438\u0441\u043e\u043a<\/h3>\n<p>\n\u0418\u0437 \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u043e\u043d \u0436\u0435 \u043c\u0430\u0442\u0440\u0438\u0446\u0430, \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u0441\u043f\u0438\u0441\u043a\u0443 (<b>?base::list<\/b>).<\/p>\n<p><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<pre><code class=\"python\">## lists ------------------\n\nmylist &lt;- as.list(arrmatr)\n\nis.vector(mylist)\n\nis.list(mylist)\n<\/code><\/pre>\n<p>\u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0435\u0449\u0435\u0439 \u0441\u0440\u0430\u0437\u0443:<\/p>\n<ul>\n<li>\u0421\u0445\u043b\u043e\u043f\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u0442\u043e\u0440\u043e\u0435 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0435 \u043c\u0430\u0442\u0440\u0438\u0446\u044b, \u0442\u043e \u0435\u0441\u0442\u044c, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0438 \u0441\u043f\u0438\u0441\u043e\u043a \u0438 \u0432\u0435\u043a\u0442\u043e\u0440. <\/li>\n<li>\u0421\u043f\u0438\u0441\u043e\u043a, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043e\u0442 \u044d\u0442\u0438\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432. \u041d\u0430\u0434\u043e \u0438\u043c\u0435\u0442\u044c \u0432 \u0432\u0438\u0434\u0443, \u0447\u0442\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443 \u0441\u043f\u0438\u0441\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043e\u0434\u043d\u043e (\u0441\u043a\u0430\u043b\u044f\u0440\u043d\u043e\u0435) \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 \u044f\u0447\u0435\u0439\u043a\u0438 \u043c\u0430\u0442\u0440\u0438\u0446\u044b-\u043c\u0430\u0441\u0441\u0438\u0432\u0430.<\/li>\n<\/ul>\n<p>\n\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0441\u043f\u0438\u0441\u043e\u043a \u044d\u0442\u043e \u0442\u0430\u043a\u0436\u0435 \u0438 \u0432\u0435\u043a\u0442\u043e\u0440, \u043a \u043d\u0435\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432.<\/p>\n<h3>\u0414\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c<\/h3>\n<p>\n\u041e\u0442 \u0441\u043f\u0438\u0441\u043a\u0430, \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0438\u043b\u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c\u0443 (<b>?base::data.frame<\/b>).<\/p>\n<p><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<pre><code class=\"python\">## data.frames ------------\n\ndf &lt;- as.data.frame(arrmatr)\ndf2 &lt;- as.data.frame(mylist)\n\nis.list(df)\n\ndf$V6 &lt;- df$V1 + df$V2\n<\/code><\/pre>\n<p>\u0427\u0442\u043e \u0432 \u043d\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e: \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043e\u0442 \u0441\u043f\u0438\u0441\u043a\u0430! \u041a\u043e\u043b\u043e\u043d\u043a\u0438 \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c\u0430 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u044f\u0447\u0435\u0439\u043a\u0430\u043c\u0438 \u0441\u043f\u0438\u0441\u043a\u0430. \u042d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u0430\u0436\u043d\u043e \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0435 \u043a \u0441\u043f\u0438\u0441\u043a\u0430\u043c.<\/p>\n<h3>data.table<\/h3>\n<p>\n\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0414\u0422 (<b>?data.table::data.table<\/b>) \u043c\u043e\u0436\u043d\u043e \u0438\u0437 <i>\u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c\u0430<\/i>, \u0441\u043f\u0438\u0441\u043a\u0430, \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u0438\u043b\u0438 \u043c\u0430\u0442\u0440\u0438\u0446\u044b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u043e\u0442 \u0442\u0430\u043a (in place).<\/p>\n<p><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<pre><code class=\"python\">## data.tables -----------------------\nlibrary(data.table)\n\ndata.table::setDT(df)\n\nis.list(df)\n\nis.data.frame(df)\n\nis.data.table(df)\n<\/code><\/pre>\n<p>\u041f\u043e\u043b\u0435\u0437\u043d\u043e \u0442\u043e, \u0447\u0442\u043e, \u043a\u0430\u043a \u0438 \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c, \u0414\u0422 \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0441\u043f\u0438\u0441\u043a\u0430.<\/p>\n<h3>\u0414\u0422 \u0438 \u043f\u0430\u043c\u044f\u0442\u044c<\/h3>\n<p>\n\u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u0432\u0441\u0435\u0445 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0432 R base, \u0414\u0422 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435. \u0415\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u043d\u043e\u0432\u0443\u044e \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u0438, \u043d\u0443\u0436\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <b>data.table::copy<\/b> \u043b\u0438\u0431\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u044b\u0431\u043e\u0440\u043a\u0443 \u0438\u0437 \u0441\u0442\u0430\u0440\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430.<\/p>\n<p><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<pre><code class=\"python\">df2 &lt;- df\n\ndf[V1 == 1, V2 := 999]\n\ndata.table::fsetdiff(df, df2)\n\ndf2 &lt;- data.table::copy(df)\n\ndf[V1 == 2, V2 := 999]\n\ndata.table::fsetdiff(df, df2)\n<\/code><\/pre>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u043a \u043a\u043e\u043d\u0446\u0443. \u0414\u0422 \u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 R, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0437\u0430 \u0441\u0447\u0435\u0442 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0438 \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439, \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043c\u044b\u0445 \u043d\u0430\u0434 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438 \u043a\u043b\u0430\u0441\u0441\u0430 \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043e\u0432.<\/p>\n<h2>\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432 data.table<\/h2>\n<p><\/p>\n<h3>\u041a\u0430\u043a \u0441\u043f\u0438\u0441\u043e\u043a&#8230;<\/h3>\n<p>\n\u0418\u0442\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c \u0434\u0430\u0442\u0430\u0444\u0440\u0435\u0439\u043c\u0430 \u0438\u043b\u0438 \u0414\u0422 \u043d\u0435 \u043b\u0443\u0447\u0448\u0430\u044f \u0438\u0434\u0435\u044f, \u0442\u0430\u043a \u043a\u0430\u043a \u043a\u043e\u0434 \u0446\u0438\u043a\u043b\u0430 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 <b>R<\/b> \u0433\u043e\u0440\u0430\u0437\u0434\u043d\u043e \u043c\u0435\u0434\u043b\u0435\u043d\u0435\u0435 <b>C<\/b>, \u0430 \u043f\u0440\u043e\u0439\u0442\u0438\u0441\u044c \u0432 \u0446\u0438\u043a\u043b\u0435 \u043f\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0445, \u043e\u0431\u044b\u0447\u043d\u043e, \u0433\u043e\u0440\u0430\u0437\u0434\u043d\u043e \u043c\u0435\u043d\u044c\u0448\u0435, \u0432\u043f\u043e\u043b\u043d\u0435 \u043c\u043e\u0436\u043d\u043e. \u0418\u0434\u044f \u043f\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430\u043c, \u043f\u043e\u043c\u043d\u0438\u043c, \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0441\u0442\u043e\u043b\u0431\u0435\u0446 \u044d\u0442\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0441\u043f\u0438\u0441\u043a\u0430, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0432\u0435\u043a\u0442\u043e\u0440. \u0410 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043d\u0430\u0434 \u0432\u0435\u043a\u0442\u043e\u0440\u0430\u043c\u0438 \u0445\u043e\u0440\u043e\u0448\u043e \u0432\u0435\u043a\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u0432 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445 \u044f\u0437\u044b\u043a\u0430. \u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u0432\u044b\u0431\u043e\u0440\u043a\u0438, \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0441\u043f\u0438\u0441\u043a\u0430\u043c \u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u0430\u043c: <b>`[[`, `$`<\/b>.<\/p>\n<p><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<pre><code class=\"python\">## operations on data.tables ------------\n\n#using list properties\n\ndf$'V1'[1]\n\ndf[['V1']]\n\ndf[[1]][1]\n\nsapply(df, class)\n\nsapply(df, function(x) sum(is.na(x)))\n<\/code><\/pre>\n<h3>\u0412\u0435\u043a\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f<\/h3>\n<p>\n\u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u0439\u0442\u0438 \u043f\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0414\u0422, \u043b\u0443\u0447\u0448\u0438\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441 \u0432\u0435\u043a\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0435\u0439. \u041d\u043e \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0442\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u0446\u0438\u043a\u043b <i>\u0432\u043d\u0443\u0442\u0440\u0438 <\/i> \u0414\u0422 \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0446\u0438\u043a\u043b\u0430 \u0432 <b>R<\/b>, \u0442\u0430\u043a \u043a\u0430\u043a \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 <b>C<\/b>.<\/p>\n<p>\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043d\u0430 \u0431\u041e\u043b\u044c\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441\u043e 100\u041a \u0441\u0442\u0440\u043e\u043a. \u0411\u0443\u0434\u0435\u043c \u0432\u044b\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0432\u0443\u044e \u0431\u0443\u043a\u0432\u0443 \u0438\u0437 \u0441\u043b\u043e\u0432, \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0432 \u0432\u0435\u043a\u0442\u043e\u0440-\u043a\u043e\u043b\u043e\u043d\u043a\u0443 <b>w<\/b>.<\/p>\n<p><i>Updated<\/i><\/p>\n<p><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<pre><code class=\"python\">library(magrittr)\nlibrary(microbenchmark)\n\n## Bigger example ----\n\nrown &lt;- 100000\n\ndt &lt;- \n\tdata.table(\n\t\tw = sapply(seq_len(rown), function(x) paste(sample(letters, 3, replace = T), collapse = ' '))\n\t\t, a = sample(letters, rown, replace = T)\n\t\t, b = runif(rown, -3, 3)\n\t\t, c = runif(rown, -3, 3)\n\t\t, e = rnorm(rown)\n\t) %&gt;%\n\t.[, d := 1 + b + c + rnorm(nrow(.))]\n\n# vectorization\n\nmicrobenchmark({\n\tdt[\n\t\t, first_l := unlist(strsplit(w, split = ' ', fixed = T))[1]\n\t\t, by = 1:nrow(dt)\n\t   ]\n})\n\n# second\n\nfirst_l_f &lt;- function(sd)\n{\n\tstrsplit(sd, split = ' ', fixed = T) %&gt;%\n\t\tdo.call(rbind, .) %&gt;%\n\t\t`[`(,1)\n}\n\ndt[, first_l := NULL]\n\nmicrobenchmark({\n\tdt[\n\t\t, first_l := .(first_l_f(w))\n\t\t]\n})\n\n# third\n\nfirst_l_f2 &lt;- function(sd)\n{\n\tstrsplit(sd, split = ' ', fixed = T) %&gt;%\n\t\tunlist %&gt;%\n\t\tmatrix(nrow = 3) %&gt;%\n\t\t`[`(1,)\n}\n\ndt[, first_l := NULL]\n\nmicrobenchmark({\n\tdt[\n\t\t, first_l := .(first_l_f2(w))\n\t\t]\n})\n<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u043f\u0440\u043e\u0433\u043e\u043d \u0441 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0435\u0439 \u043f\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c:<\/p>\n<blockquote><p>Unit: milliseconds<br \/>\n expr min<br \/>\n { dt[, `:=`(first_l, unlist(strsplit(w, split = &quot; &quot;, fixed = T))[1]), by = 1:nrow(dt)] } 439.6217<br \/>\n lq mean median uq max neval<br \/>\n 451.9998 460.1593 456.2505 <b>460.9147<\/b> 621.4042 100<\/p><\/blockquote>\n<p>\n\u0412\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u043e\u0433\u043e\u043d, \u0433\u0434\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0438\u0434\u0435\u0442 \u0447\u0435\u0440\u0435\u0437 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u0441\u043f\u0438\u0441\u043a\u0430 \u0432 \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u0438 \u0432\u0437\u044f\u0442\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043d\u0430 \u0441\u0440\u0435\u0437\u0435 \u0441 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u043c 1 (\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0438 \u0435\u0441\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432\u0435\u043a\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f). \u041f\u043e\u043f\u0440\u0430\u0432\u043b\u044e\u0441\u044c: \u0432\u0435\u043a\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <b>strsplit<\/b>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443\u043c\u0435\u0435\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0432\u0435\u043a\u0442\u043e\u0440 \u043d\u0430 \u0432\u0445\u043e\u0434. \u041e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u0432 \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0442\u044f\u0436\u0435\u043b\u0435\u0435 \u0441\u0430\u043c\u043e\u0439 \u0432\u0435\u043a\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438, \u043d\u043e \u0438 \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u043d\u0435\u0432\u0435\u043a\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430.<\/p>\n<blockquote><p>Unit: milliseconds<br \/>\n expr min lq mean median uq max neval<br \/>\n { dt[, `:=`(first_l, .(first_l_f(w)))] } 93.07916 112.1381 161.9267 <b>149.6863<\/b> 185.9893 442.5199 100\n<\/p><\/blockquote>\n<p>\n\u0423\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u0435 \u043f\u043e \u043c\u0435\u0434\u0438\u0430\u043d\u0435 \u0432 <b>3 \u0440\u0430\u0437<\/b>.<\/p>\n<p>\u0422\u0440\u0435\u0442\u0438\u0439 \u043f\u0440\u043e\u0433\u043e\u043d, \u0433\u0434\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0430 \u0441\u0445\u0435\u043c\u0430 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0432 \u043c\u0430\u0442\u0440\u0438\u0446\u0443.<\/p>\n<blockquote><p>Unit: milliseconds<br \/>\n expr min lq mean median uq max neval<br \/>\n { dt[, `:=`(first_l, .(first_l_f2(w)))] } 32.60481 34.13679 40.4544 <b>35.57115<\/b> 42.11975 222.972 100\n<\/p><\/blockquote>\n<p>\n\u0423\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u0435 \u043f\u043e \u043c\u0435\u0434\u0438\u0430\u043d\u0435 \u0432 <b>13 \u0440\u0430\u0437<\/b>.<\/p>\n<p>\u0421 \u044d\u0442\u0438\u043c \u0434\u0435\u043b\u043e\u043c \u043d\u0430\u0434\u043e \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0447\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u2014 \u0442\u0435\u043c \u043b\u0443\u0447\u0448\u0435 \u0431\u0443\u0434\u0435\u0442.<\/p>\n<p>\u0415\u0449\u0435 \u043e\u0434\u0438\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u0441 \u0432\u0435\u043a\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0435\u0439, \u0433\u0434\u0435 \u0442\u0430\u043a\u0436\u0435 \u0442\u0435\u043a\u0441\u0442, \u043d\u043e \u043e\u043d \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0435\u043d \u043a \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u043c \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c: \u0440\u0430\u0437\u043d\u0430\u044f \u0434\u043b\u0438\u043d\u0430 \u0441\u043b\u043e\u0432, \u0440\u0430\u0437\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043b\u043e\u0432. \u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u044c \u043f\u0435\u0440\u0432\u044b\u0435 3 \u0441\u043b\u043e\u0432\u0430. \u0412\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<p><img decoding=\"async\" alt=\"\u0412\u043e\u043a\u0440\u0443\u0433 data.table\" src=\"\/wp-content\/uploads\/2020\/03\/6a433299b3cc382a74a5336d4d1a7b48.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\n\u0417\u0434\u0435\u0441\u044c \u0443\u0436\u0435 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0442\u0430\u043a \u043a\u0430\u043a \u0432\u0435\u043a\u0442\u043e\u0440\u044b \u0440\u0430\u0437\u043d\u043e\u0439 \u0434\u043b\u0438\u043d\u044b, \u0430 \u043c\u044b \u0437\u0430\u0434\u0430\u0432\u0430\u043b\u0438 \u0440\u0430\u0437\u043c\u0435\u0440 \u043c\u0430\u0442\u0440\u0438\u0446\u044b. \u041f\u0435\u0440\u0435\u0434\u0435\u043b\u0430\u0435\u043c \u044d\u0442\u043e, \u043f\u043e\u043a\u043e\u043f\u0430\u0432\u0448\u0438\u0441\u044c \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430\u0445.<\/p>\n<p><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<pre><code class=\"python\"># fourth\n\nrown &lt;- 100000\n\nwords &lt;-\n\tsapply(\n\t\tseq_len(rown)\n\t\t, function(x){\n\t\t\tnwords &lt;- rbinom(1, 10, 0.5)\n\t\t\tpaste(\n\t\t\t\tsapply(\n\t\t\t\t\tseq_len(nwords)\n\t\t\t\t\t, function(x){\n\t\t\t\t\t\tpaste(sample(letters, rbinom(1, 10, 0.5), replace = T), collapse = '')\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t\t, collapse = ' '\n\t\t\t)\n\t\t}\n\t)\n\ndt &lt;- \n\tdata.table(\n\t\tw = words\n\t\t, a = sample(letters, rown, replace = T)\n\t\t, b = runif(rown, -3, 3)\n\t\t, c = runif(rown, -3, 3)\n\t\t, e = rnorm(rown)\n\t) %&gt;%\n\t.[, d := 1 + b + c + rnorm(nrow(.))]\n\nfirst_l_f3 &lt;- function(sd, n)\n{\n\tl &lt;- strsplit(sd, split = ' ', fixed = T)\n\t\n\tmaxl &lt;- max(lengths(l))\n\t\n\tsapply(l, &quot;length&lt;-&quot;, maxl) %&gt;%\n\t\t`[`(n,) %&gt;%\n\t\tas.character\n}\n\nmicrobenchmark({\n\tdt[\n\t\t, (paste0('w_', 1:3)) := lapply(1:3, function(x) first_l_f3(w, x))\n\t\t]\n})\n\ndt[\n\t, (paste0('w_', 1:3)) := lapply(1:3, function(x) first_l_f3(w, x))\n\t]\n<\/code><\/pre>\n<p>\nUnit: milliseconds<br \/>\n expr min lq mean median<\/p>\n<blockquote><p> { dt[, `:=`((paste0(\u00abw_\u00bb, 1:3)), strsplit(w, split = &quot; &quot;, fixed = T))] } 851.7623 916.071 1054.5 <b>1035.199<\/b><br \/>\n uq max neval<br \/>\n 1178.738 1356.816 100<\/p><\/blockquote>\n<p>\u0421\u043a\u0440\u0438\u043f\u0442 \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0441\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u0439 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c\u044e 1 \u0441\u0435\u043a\u0443\u043d\u0434\u0430. \u041d\u0435\u043f\u043b\u043e\u0445\u043e.<\/p>\n<h3>\u0421\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043e\u0434\u043d\u043e\u0439 \u0446\u0435\u043f\u044c\u044e&#8230;<\/h3>\n<p>\n\u0421 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438 \u0414\u0422 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f chaining. \u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u044d\u0442\u043e \u043a\u0430\u043a \u043f\u0440\u0438\u0446\u0435\u043f\u043b\u0435\u043d\u0438\u0435 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 \u0441\u043a\u043e\u0431\u043e\u043a \u0441\u043f\u0440\u0430\u0432\u0430, \u043f\u043e \u0441\u0443\u0442\u0438, \u0441\u0430\u0445\u0430\u0440\u043e\u043a.<\/p>\n<p><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<pre><code class=\"python\"># chaining\n\nres1 &lt;- dt[a == 'a'][sample(.N, 100)]\n\nres2 &lt;- dt[, .N, a][, N]\n\nres3 &lt;- dt[, coefficients(lm(e ~ d))[1], a][, .(letter = a, coef = V1)]\n\n<\/code><\/pre>\n<h3>\u0422\u0435\u0447\u0435\u0442 \u043f\u043e \u0442\u0440\u0443\u0431\u0430\u043c&#8230;<\/h3>\n<p>\n\u0422\u0430\u043a\u0438\u0435 \u0436\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 piping, \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u043e\u0445\u043e\u0436\u0435, \u043d\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e \u0431\u043e\u0433\u0430\u0447\u0435, \u0442\u0430\u043a \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u044e\u0431\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b, \u0430 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0414\u0422. \u0412\u044b\u0432\u0435\u0434\u0435\u043c \u043a\u043e\u044d\u044d\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u044b \u043b\u043e\u0433\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438 \u0434\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u0440\u044f\u0434\u043e\u043c \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432 \u043d\u0430 \u0414\u0422.<\/p>\n<p><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<pre><code class=\"python\"># piping\n\nsamplpe_b &lt;- dt[a %in% head(letters), sample(b, 1)]\n\nres4 &lt;- \n\tdt %&gt;%\n\t.[a %in% head(letters)] %&gt;%\n\t.[, \n\t  {\n\t  \tdt0 &lt;- .SD[1:100]\n\t  \t\n\t  \tquants &lt;- \n\t  \t\tdt0[, c] %&gt;%\n\t  \t\tquantile(seq(0.1, 1, 0.1), na.rm = T)\n\t  \t\n\t  \t.(q = quants)\n\t  }\n\t  , .(cond = b &gt; samplpe_b)\n\t  ] %&gt;%\n\tglm(\n\t\tcond ~ q -1\n\t\t, family = binomial(link = &quot;logit&quot;)\n\t\t, data = .\n\t) %&gt;%\n\tsummary %&gt;%\n\t.[[12]]\n<\/code><\/pre>\n<h3>\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430, \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u0438 \u043f\u0440\u043e\u0447\u0435\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 \u0414\u0422<\/h3>\n<p>\n\u041c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u044f\u043c\u0431\u0434\u0430-\u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043d\u043e \u0438\u043d\u043e\u0433\u0434\u0430 \u043b\u0443\u0447\u0448\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0438\u0445 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e, \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0432\u0435\u0441\u044c \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445, \u0438 \u0432\u043f\u0435\u0440\u0435\u0434 \u2014 \u043e\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0432\u043d\u0443\u0442\u0440\u0438 \u0414\u0422. \u041f\u0440\u0438\u043c\u0435\u0440 \u043e\u0431\u043e\u0433\u0430\u0449\u0435\u043d \u0432\u0441\u0435\u043c\u0438 \u0432\u044b\u0448\u0435\u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0444\u0438\u0447\u0430\u043c\u0438, \u043f\u043b\u044e\u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u0432\u0435\u0449\u0435\u0439 \u0438\u0437 \u0430\u0440\u0441\u0435\u043d\u0430\u043b\u0430 \u0414\u0422 (\u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a \u0441\u0430\u043c\u043e\u043c\u0443 \u0414\u0422 \u0432\u043d\u0443\u0442\u0440\u0438 \u0414\u0422 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435, \u0432\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0438\u043d\u043e\u0433\u0434\u0430 \u043d\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u043e \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e).<\/p>\n<p><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<pre><code class=\"python\"># function\n\nrm(lm_preds)\n\nlm_preds &lt;- function(\n\tsd, by, n\n)\n{\n\t\n\tif(\n\t\tn &lt; 100 | \n\t\t!by[['a']] %in% head(letters, 4)\n\t   )\n\t{\n\t\t\n\t\tres &lt;-\n\t\t\tlist(\n\t\t\t\tlow = NA\n\t\t\t\t, mean = NA\n\t\t\t\t, high = NA\n\t\t\t\t, coefs = NA\n\t\t\t)\n\t\t\n\t} else {\n\n\t\tlmm &lt;- \n\t\t\tlm(\n\t\t\t\td ~ c + b\n\t\t\t\t, data = sd\n\t\t\t)\n\t\t\n\t\tpreds &lt;- \n\t\t\tstats::predict.lm(\n\t\t\t\tlmm\n\t\t\t\t, sd\n\t\t\t\t, interval = &quot;prediction&quot;\n\t\t\t\t)\n\t\t\n\t\tres &lt;-\n\t\t\tlist(\n\t\t\t\tlow = preds[, 2]\n\t\t\t\t, mean = preds[, 1]\n\t\t\t\t, high = preds[, 3]\n\t\t\t\t, coefs = coefficients(lmm)\n\t\t\t)\n\t}\n\n\tres\n\t\n}\n\nres5 &lt;- \n\tdt %&gt;%\n\t.[e &lt; 0] %&gt;%\n\t.[.[, .I[b &gt; 0]]] %&gt;%\n\t.[, `:=` (\n\t\tlow = as.numeric(lm_preds(.SD, .BY, .N)[[1]])\n\t\t, mean = as.numeric(lm_preds(.SD, .BY, .N)[[2]])\n\t\t, high = as.numeric(lm_preds(.SD, .BY, .N)[[3]])\n\t\t, coef_c = as.numeric(lm_preds(.SD, .BY, .N)[[4]][1])\n\t\t, coef_b = as.numeric(lm_preds(.SD, .BY, .N)[[4]][2])\n\t\t, coef_int = as.numeric(lm_preds(.SD, .BY, .N)[[4]][3])\n\t)\n\t, a\n\t] %&gt;%\n\t.[!is.na(mean), -'e', with = F]\n\n\n# plot\n\nplo &lt;- \n\tres5 %&gt;%\n\tggplot +\n\tfacet_wrap(~ a) +\n\tgeom_ribbon(\n\t\taes(\n\t\t\tx = c * coef_c + b * coef_b + coef_int\n\t\t\t, ymin = low\n\t\t\t, ymax = high\n\t\t\t, fill = a\n\t\t)\n\t\t, size = 0.1\n\t\t, alpha = 0.1\n\t) +\n\tgeom_point(\n\t\taes(\n\t\t\tx = c * coef_c + b * coef_b + coef_int\n\t\t\t, y = mean\n\t\t\t, color = a\n\t\t)\n\t\t, size = 1\n\t) +\n\tgeom_point(\n\t\taes(\n\t\t\tx = c * coef_c + b * coef_b + coef_int\n\t\t\t, y = d\n\t\t)\n\t\t, size = 1\n\t\t, color = 'black'\n\t) +\n\ttheme_minimal()\n\nprint(plo)\n\n<\/code><\/pre>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\n\u042f \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u0441\u043c\u043e\u0433 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0446\u0435\u043b\u044c\u043d\u0443\u044e, \u043d\u043e, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043d\u0435 \u043f\u043e\u043b\u043d\u0443\u044e, \u043a\u0430\u0440\u0442\u0438\u043d\u0443 \u0442\u0430\u043a\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043a\u0430\u043a data.table, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u043e\u0442 \u0435\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043e\u0442 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 R \u0438 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u044f \u0435\u0433\u043e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c\u0438 \u0444\u0438\u0448\u043a\u0430\u043c\u0438 \u0438 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435\u043c \u0438\u0437 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 tidyverse. \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u044d\u0442\u043e \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0432\u0430\u043c \u043b\u0443\u0447\u0448\u0435 \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u044d\u0442\u0443 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0438 <i>\u0440\u0430\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f<\/i>.<\/p>\n<p><img decoding=\"async\" alt=\"\u0412\u043e\u043a\u0440\u0443\u0433 data.table\" src=\"\/wp-content\/uploads\/2020\/03\/0cf1b3b83b658728426866af11bff022.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\n\u0421\u043f\u0430\u0441\u0438\u0431\u043e!<\/p>\n<h3>\u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434<\/h3>\n<p>\n<b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<pre><code class=\"python\">## load libs ----------------\n\nlibrary(data.table)\nlibrary(ggplot2)\nlibrary(magrittr)\nlibrary(microbenchmark)\n\n\n## arrays ---------\n\narrmatr &lt;- array(1:20, c(4,5))\n\nclass(arrmatr)\n\ntypeof(arrmatr)\n\nis.array(arrmatr)\n\nis.matrix(arrmatr)\n\n\n## lists ------------------\n\nmylist &lt;- as.list(arrmatr)\n\nis.vector(mylist)\n\nis.list(mylist)\n\n\n## data.frames ------------\n\ndf &lt;- as.data.frame(arrmatr)\n\nis.list(df)\n\ndf$V6 &lt;- df$V1 + df$V2\n\n\n## data.tables -----------------------\n\ndata.table::setDT(df)\n\nis.list(df)\n\nis.data.frame(df)\n\nis.data.table(df)\n\ndf2 &lt;- df\n\ndf[V1 == 1, V2 := 999]\n\ndata.table::fsetdiff(df, df2)\n\ndf2 &lt;- data.table::copy(df)\n\ndf[V1 == 2, V2 := 999]\n\ndata.table::fsetdiff(df, df2)\n\n\n## operations on data.tables ------------\n\n#using list properties\n\ndf$'V1'[1]\n\ndf[['V1']]\n\ndf[[1]][1]\n\nsapply(df, class)\n\nsapply(df, function(x) sum(is.na(x)))\n\n\n## Bigger example ----\n\nrown &lt;- 100000\n\ndt &lt;- \n\tdata.table(\n\t\tw = sapply(seq_len(rown), function(x) paste(sample(letters, 3, replace = T), collapse = ' '))\n\t\t, a = sample(letters, rown, replace = T)\n\t\t, b = runif(rown, -3, 3)\n\t\t, c = runif(rown, -3, 3)\n\t\t, e = rnorm(rown)\n\t) %&gt;%\n\t.[, d := 1 + b + c + rnorm(nrow(.))]\n\n# vectorization\n\n# zero - for loop\n\nmicrobenchmark({\n\tfor(i in 1:nrow(dt))\n\t\t{\n\t\tdt[\n\t\t\ti\n\t\t\t, first_l := unlist(strsplit(w, split = ' ', fixed = T))[1]\n\t\t]\n\t}\n})\n\n# first\n\nmicrobenchmark({\n\tdt[\n\t\t, first_l := unlist(strsplit(w, split = ' ', fixed = T))[1]\n\t\t, by = 1:nrow(dt)\n\t   ]\n})\n\n# second\n\nfirst_l_f &lt;- function(sd)\n{\n\tstrsplit(sd, split = ' ', fixed = T) %&gt;%\n\t\tdo.call(rbind, .) %&gt;%\n\t\t`[`(,1)\n}\n\ndt[, first_l := NULL]\n\nmicrobenchmark({\n\tdt[\n\t\t, first_l := .(first_l_f(w))\n\t\t]\n})\n\n# third\n\nfirst_l_f2 &lt;- function(sd)\n{\n\tstrsplit(sd, split = ' ', fixed = T) %&gt;%\n\t\tunlist %&gt;%\n\t\tmatrix(nrow = 3) %&gt;%\n\t\t`[`(1,)\n}\n\ndt[, first_l := NULL]\n\nmicrobenchmark({\n\tdt[\n\t\t, first_l := .(first_l_f2(w))\n\t\t]\n})\n\n# fourth\n\nrown &lt;- 100000\n\nwords &lt;-\n\tsapply(\n\t\tseq_len(rown)\n\t\t, function(x){\n\t\t\tnwords &lt;- rbinom(1, 10, 0.5)\n\t\t\tpaste(\n\t\t\t\tsapply(\n\t\t\t\t\tseq_len(nwords)\n\t\t\t\t\t, function(x){\n\t\t\t\t\t\tpaste(sample(letters, rbinom(1, 10, 0.5), replace = T), collapse = '')\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t\t, collapse = ' '\n\t\t\t)\n\t\t}\n\t)\n\ndt &lt;- \n\tdata.table(\n\t\tw = words\n\t\t, a = sample(letters, rown, replace = T)\n\t\t, b = runif(rown, -3, 3)\n\t\t, c = runif(rown, -3, 3)\n\t\t, e = rnorm(rown)\n\t) %&gt;%\n\t.[, d := 1 + b + c + rnorm(nrow(.))]\n\nfirst_l_f3 &lt;- function(sd, n)\n{\n\tl &lt;- strsplit(sd, split = ' ', fixed = T)\n\t\n\tmaxl &lt;- max(lengths(l))\n\t\n\tsapply(l, &quot;length&lt;-&quot;, maxl) %&gt;%\n\t\t`[`(n,) %&gt;%\n\t\tas.character\n}\n\nmicrobenchmark({\n\tdt[\n\t\t, (paste0('w_', 1:3)) := lapply(1:3, function(x) first_l_f3(w, x))\n\t\t]\n})\n\ndt[\n\t, (paste0('w_', 1:3)) := lapply(1:3, function(x) first_l_f3(w, x))\n\t]\n\n\n# chaining\n\nres1 &lt;- dt[a == 'a'][sample(.N, 100)]\n\nres2 &lt;- dt[, .N, a][, N]\n\nres3 &lt;- dt[, coefficients(lm(e ~ d))[1], a][, .(letter = a, coef = V1)]\n\n# piping\n\nsamplpe_b &lt;- dt[a %in% head(letters), sample(b, 1)]\n\nres4 &lt;- \n\tdt %&gt;%\n\t.[a %in% head(letters)] %&gt;%\n\t.[, \n\t  {\n\t  \tdt0 &lt;- .SD[1:100]\n\t  \t\n\t  \tquants &lt;- \n\t  \t\tdt0[, c] %&gt;%\n\t  \t\tquantile(seq(0.1, 1, 0.1), na.rm = T)\n\t  \t\n\t  \t.(q = quants)\n\t  }\n\t  , .(cond = b &gt; samplpe_b)\n\t  ] %&gt;%\n\tglm(\n\t\tcond ~ q -1\n\t\t, family = binomial(link = &quot;logit&quot;)\n\t\t, data = .\n\t) %&gt;%\n\tsummary %&gt;%\n\t.[[12]]\n\n\n# function\n\nrm(lm_preds)\n\nlm_preds &lt;- function(\n\tsd, by, n\n)\n{\n\t\n\tif(\n\t\tn &lt; 100 | \n\t\t!by[['a']] %in% head(letters, 4)\n\t   )\n\t{\n\t\t\n\t\tres &lt;-\n\t\t\tlist(\n\t\t\t\tlow = NA\n\t\t\t\t, mean = NA\n\t\t\t\t, high = NA\n\t\t\t\t, coefs = NA\n\t\t\t)\n\t\t\n\t} else {\n\n\t\tlmm &lt;- \n\t\t\tlm(\n\t\t\t\td ~ c + b\n\t\t\t\t, data = sd\n\t\t\t)\n\t\t\n\t\tpreds &lt;- \n\t\t\tstats::predict.lm(\n\t\t\t\tlmm\n\t\t\t\t, sd\n\t\t\t\t, interval = &quot;prediction&quot;\n\t\t\t\t)\n\t\t\n\t\tres &lt;-\n\t\t\tlist(\n\t\t\t\tlow = preds[, 2]\n\t\t\t\t, mean = preds[, 1]\n\t\t\t\t, high = preds[, 3]\n\t\t\t\t, coefs = coefficients(lmm)\n\t\t\t)\n\t}\n\n\tres\n\t\n}\n\nres5 &lt;- \n\tdt %&gt;%\n\t.[e &lt; 0] %&gt;%\n\t.[.[, .I[b &gt; 0]]] %&gt;%\n\t.[, `:=` (\n\t\tlow = as.numeric(lm_preds(.SD, .BY, .N)[[1]])\n\t\t, mean = as.numeric(lm_preds(.SD, .BY, .N)[[2]])\n\t\t, high = as.numeric(lm_preds(.SD, .BY, .N)[[3]])\n\t\t, coef_c = as.numeric(lm_preds(.SD, .BY, .N)[[4]][1])\n\t\t, coef_b = as.numeric(lm_preds(.SD, .BY, .N)[[4]][2])\n\t\t, coef_int = as.numeric(lm_preds(.SD, .BY, .N)[[4]][3])\n\t)\n\t, a\n\t] %&gt;%\n\t.[!is.na(mean), -'e', with = F]\n\n\n# plot\n\nplo &lt;- \n\tres5 %&gt;%\n\tggplot +\n\tfacet_wrap(~ a) +\n\tgeom_ribbon(\n\t\taes(\n\t\t\tx = c * coef_c + b * coef_b + coef_int\n\t\t\t, ymin = low\n\t\t\t, ymax = high\n\t\t\t, fill = a\n\t\t)\n\t\t, size = 0.1\n\t\t, alpha = 0.1\n\t) +\n\tgeom_point(\n\t\taes(\n\t\t\tx = c * coef_c + b * coef_b + coef_int\n\t\t\t, y = mean\n\t\t\t, color = a\n\t\t)\n\t\t, size = 1\n\t) +\n\tgeom_point(\n\t\taes(\n\t\t\tx = c * coef_c + b * coef_b + coef_int\n\t\t\t, y = d\n\t\t)\n\t\t, size = 1\n\t\t, color = 'black'\n\t) +\n\ttheme_minimal()\n\nprint(plo)\n<\/code><\/pre>\n<p>\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a: <a content=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/493132\/\">habr.com<\/a> <\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>\u042d\u0442\u0430 \u0437\u0430\u043c\u0435\u0442\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430 \u0434\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0442\u0430\u0431\u043b\u0438\u0447\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f R \u2014 data.table, \u0438, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0434 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u044c \u0435\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043d\u0430 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445. \u0412\u0434\u043e\u0445\u043d\u043e\u0432\u0438\u0432\u0448\u0438\u0441\u044c \u0445\u043e\u0440\u043e\u0448\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u043a\u043e\u043b\u043b\u0435\u0433\u0438, \u0438 \u043d\u0430\u0434\u0435\u044f\u0441\u044c, \u0447\u0442\u043e \u0432\u044b \u0443\u0436\u0435 \u043f\u043e\u0447\u0438\u0442\u0430\u043b\u0438 \u0435\u0433\u043e \u0441\u0442\u0430\u0442\u044c\u044e, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0433\u043b\u0443\u0431\u0436\u0435 \u043a\u043e\u043f\u043d\u0443\u0442\u044c \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430 \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 data.table. \u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435: \u043e\u0442\u043a\u0443\u0434\u0430 \u0438\u0434\u0435\u0442 data.table? [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":74951,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[688],"tags":[],"class_list":["post-74950","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-administrirovanie"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u042d\u0442\u0430 \u0437\u0430\u043c\u0435\u0442\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430 \u0434\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0442\u0430\u0431\u043b\u0438\u0447\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f R \u2014 data.table, \u0438, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0434 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u044c \u0435\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043d\u0430 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445. \u0412\u0434\u043e\u0445\u043d\u043e\u0432\u0438\u0432\u0448\u0438\u0441\u044c \u0445\u043e\u0440\u043e\u0448\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u043a\u043e\u043b\u043b\u0435\u0433\u0438, \u0438 \u043d\u0430\u0434\u0435\u044f\u0441\u044c, \u0447\u0442\u043e \u0432\u044b \u0443\u0436\u0435 \u043f\u043e\u0447\u0438\u0442\u0430\u043b\u0438 \u0435\u0433\u043e \u0441\u0442\u0430\u0442\u044c\u044e, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0433\u043b\u0443\u0431\u0436\u0435 \u043a\u043e\u043f\u043d\u0443\u0442\u044c \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430 \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 data.table. \u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435: \u043e\u0442\u043a\u0443\u0434\u0430 \u0438\u0434\u0435\u0442 data.table?\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/de\/blog\/administrirovanie\/vokrug-data-table\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<meta property=\"og:locale\" content=\"de_DE\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47\u0412\u043e\u043a\u0440\u0443\u0433 data.table | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"\u042d\u0442\u0430 \u0437\u0430\u043c\u0435\u0442\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430 \u0434\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0442\u0430\u0431\u043b\u0438\u0447\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f R \u2014 data.table, \u0438, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0434 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u044c \u0435\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043d\u0430 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445. \u0412\u0434\u043e\u0445\u043d\u043e\u0432\u0438\u0432\u0448\u0438\u0441\u044c \u0445\u043e\u0440\u043e\u0448\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u043a\u043e\u043b\u043b\u0435\u0433\u0438, \u0438 \u043d\u0430\u0434\u0435\u044f\u0441\u044c, \u0447\u0442\u043e \u0432\u044b \u0443\u0436\u0435 \u043f\u043e\u0447\u0438\u0442\u0430\u043b\u0438 \u0435\u0433\u043e \u0441\u0442\u0430\u0442\u044c\u044e, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0433\u043b\u0443\u0431\u0436\u0435 \u043a\u043e\u043f\u043d\u0443\u0442\u044c \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430 \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 data.table. \u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435: \u043e\u0442\u043a\u0443\u0434\u0430 \u0438\u0434\u0435\u0442 data.table?\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/de\/blog\/administrirovanie\/vokrug-data-table\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2020-03-22T05:42:19+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2020-03-22T05:42:19+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47Rund um data.table | ProHoster","description":"Dieser Artikel wird f\u00fcr diejenigen von Interesse sein, die die Datenverarbeitungsbibliothek f\u00fcr R - data.table - verwenden und m\u00f6glicherweise die Flexibilit\u00e4t ihrer Anwendung in verschiedenen Beispielen zu sch\u00e4tzen wissen. Inspiriert von einem guten Beispiel eines Kollegen und in der Hoffnung, dass Sie bereits seinen Artikel gelesen haben, lade ich Sie ein, tiefer in die Optimierung von Code und Leistung auf der Grundlage von data.table einzutauchen. Einf\u00fchrung: Woher kommt data.table?","canonical_url":"https:\/\/prohoster.info\/de\/blog\/administrirovanie\/vokrug-data-table","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"de_DE","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47\u0412\u043e\u043a\u0440\u0443\u0433 data.table | ProHoster","og:description":"\u042d\u0442\u0430 \u0437\u0430\u043c\u0435\u0442\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430 \u0434\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0442\u0430\u0431\u043b\u0438\u0447\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f R \u2014 data.table, \u0438, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0434 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u044c \u0435\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043d\u0430 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445. \u0412\u0434\u043e\u0445\u043d\u043e\u0432\u0438\u0432\u0448\u0438\u0441\u044c \u0445\u043e\u0440\u043e\u0448\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u043a\u043e\u043b\u043b\u0435\u0433\u0438, \u0438 \u043d\u0430\u0434\u0435\u044f\u0441\u044c, \u0447\u0442\u043e \u0432\u044b \u0443\u0436\u0435 \u043f\u043e\u0447\u0438\u0442\u0430\u043b\u0438 \u0435\u0433\u043e \u0441\u0442\u0430\u0442\u044c\u044e, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0433\u043b\u0443\u0431\u0436\u0435 \u043a\u043e\u043f\u043d\u0443\u0442\u044c \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430 \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 data.table. \u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435: \u043e\u0442\u043a\u0443\u0434\u0430 \u0438\u0434\u0435\u0442 data.table?","og:url":"https:\/\/prohoster.info\/de\/blog\/administrirovanie\/vokrug-data-table","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2020-03-22T05:42:19+00:00","article:modified_time":"2020-03-22T05:42:19+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"74950","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":null,"breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2021-02-28 18:04:26","updated":"2022-09-29 19:29:05"},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/de\/wp-json\/wp\/v2\/posts\/74950","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/de\/wp-json\/wp\/v2\/comments?post=74950"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/de\/wp-json\/wp\/v2\/posts\/74950\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/prohoster.info\/de\/wp-json\/wp\/v2\/media\/74951"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/de\/wp-json\/wp\/v2\/media?parent=74950"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/de\/wp-json\/wp\/v2\/categories?post=74950"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/de\/wp-json\/wp\/v2\/tags?post=74950"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}