{"id":339398,"date":"2022-10-07T09:00:07","date_gmt":"2022-10-07T09:00:07","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=339398"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=339398","title":{"rendered":"<span>RStudio, R Markdown, Latex \u0438 \u043e\u0442\u0447\u0435\u0442\u044b \u0432 PDF \u0444\u043e\u0440\u043c\u0430\u0442\u0435. \u041c\u043e\u0439 \u043e\u043f\u044b\u0442<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u0445\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u044f \u043f\u0438\u0441\u0430\u043b \u043e\u0442\u0447\u0435\u0442\u044b \u043d\u0430 R, \u0441 \u0447\u0435\u043c \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0441\u044f \u0438 \u043a\u0430\u043a \u0440\u0435\u0448\u0430\u043b \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u043b\u0438 \u043f\u043e \u0445\u043e\u0434\u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u041e\u0442\u0447\u0435\u0442\u044b \u0431\u044b\u043b\u0438 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 PDF \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u0438\u0441\u044c \u0438\u0437 Python \u0432 Camunda. <\/p>\n<h2>1. \u0417\u0430\u043f\u0443\u0441\u043a \u043e\u0442\u0447\u0435\u0442\u043e\u0432 \u043d\u0430 R<\/h2>\n<p>\u041f\u0435\u0440\u0432\u043e\u0435, \u0441 \u0447\u0435\u043c \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u0442\u044c\u0441\u044f &#8212; \u044d\u0442\u043e \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u043e\u0442\u0447\u0435\u0442\u043e\u0432 \u043d\u0430 R \u0438\u0437 Python. \u0422\u043e\u0447\u043d\u0435\u0435 \u0438\u0437 Python \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u0438 <strong>subprocess.Popen<\/strong>,<strong> <\/strong>\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b R script. R script, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b \u043e\u0434\u043d\u0443 \u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0442\u043e\u0433\u043e \u0438\u043b\u0438 \u0438\u043d\u043e\u0433\u043e \u043e\u0442\u0447\u0435\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u044b\u043b\u0430 \u0447\u0430\u0441\u0442\u044c\u044e \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u0430\u043a \u043f\u0430\u043a\u0435\u0442 \u043d\u0430 R. \u0420\u0430\u0437\u043d\u0438\u0446\u0443 \u043c\u0435\u0436\u0434\u0443 \u043f\u0430\u043a\u0435\u0442\u043e\u043c \u0438 \u043e\u0431\u044b\u0447\u043d\u044b\u043c\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u043c\u0438 \u043d\u0430 R \u044f \u043e\u043f\u0438\u0441\u0430\u043b \u0442\u0443\u0442 &#8212; <a href=\"https:\/\/habr.com\/ru\/company\/deutschetelekomitsolutions\/blog\/548262\/\" rel=\"noopener noreferrer nofollow\">\u0441\u0441\u044b\u043b\u043a\u0430<\/a>. \u041c\u043e\u0436\u043d\u043e \u0441\u0440\u0430\u0437\u0443 \u0434\u0435\u0440\u0433\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 R \u0438 \u043c\u043e\u0439 \u043a\u043e\u043b\u043b\u0435\u0433\u0430 \u043f\u044b\u0442\u0430\u043b\u0441\u044f \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u0432\u044b\u0437\u043e\u0432 \u043e\u0442\u0447\u0435\u0442\u043e\u0432 \u0438\u0437 Python, \u043d\u043e \u0442\u043e \u043b\u0438 \u0438\u0437-\u0437\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435\u043c \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u0442\u043e \u043b\u0438 \u0438\u0437-\u0437\u0430 Camunda, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u044d\u0442\u043e \u0432\u0441\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u043e\u0441\u044c, \u0442\u0430\u043a\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e, \u043d\u043e \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u043d\u0430 \u043d\u0430\u0448\u0435\u043c \u0431\u043e\u0435\u0432\u043e\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438. \u041c\u0438\u043d\u0443\u0441\u043e\u043c \u0436\u0435 \u0432\u044b\u0437\u043e\u0432\u0430 R \u0447\u0435\u0440\u0435\u0437 <strong>subprocess.Popen <\/strong>\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u043e, \u0447\u0442\u043e Python \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 R \u0441\u043a\u0440\u0438\u043f\u0442 \u0447\u0435\u0440\u0435\u0437 shell, \u0430 \u0443\u0436\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 \u044d\u0442\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0434\u0435\u0440\u0433\u0430\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0430\u043a\u0435\u0442\u0430 R. <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/139\/d50\/3fe\/139d503fe2cfa9def458d929f671bde6.png\" alt=\"\u0417\u0430\u043f\u0443\u0441\u043a \u043e\u0442\u0447\u0435\u0442\u0430 \u0447\u0435\u0440\u0435\u0437 R script \u0444\u0430\u0439\u043b\" title=\"\u0417\u0430\u043f\u0443\u0441\u043a \u043e\u0442\u0447\u0435\u0442\u0430 \u0447\u0435\u0440\u0435\u0437 R script \u0444\u0430\u0439\u043b\" width=\"989\" height=\"161\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/139\/d50\/3fe\/139d503fe2cfa9def458d929f671bde6.png\"\/><figcaption>\u0417\u0430\u043f\u0443\u0441\u043a \u043e\u0442\u0447\u0435\u0442\u0430 \u0447\u0435\u0440\u0435\u0437 R script \u0444\u0430\u0439\u043b<\/figcaption><\/figure>\n<p>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0434\u043b\u044f \u043e\u0442\u0447\u0435\u0442\u0430 \u0442\u043e\u0436\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 shell \u0438 \u0443\u0436\u0435 \u0432 R script \u0444\u0430\u0439\u043b\u0435 \u0442\u0430\u043a \u0436\u0435 \u0438\u0445 \u0447\u0438\u0442\u0430\u0442\u044c \u043a\u0430\u043a \u0431\u0443\u0434\u044c \u0442\u043e \u0438\u0445 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442 \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443. <\/p>\n<p>\u0427\u0430\u0441\u0442\u044c \u043a\u043e\u0434\u0430 \u043d\u0430 Python: <\/p>\n<pre><code class=\"python\">parameters = {             \"param1\": param1,             \"param2\": param2,             \"param3\": param3         } ...  command_list = [\"Rscript\", path_to_r_script] + [f\"--{key}={value}\" for key, value in parameters.items()]  with subprocess.Popen(   command_list, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=work_dir ) as sub_prc_response:   stdout, stderr = sub_prc_response.communicate()   return_code = sub_prc_response.returncode <\/code><\/pre>\n<p>Script \u043d\u0430 R, \u0433\u0434\u0435 <strong>ourpackage <\/strong>\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0430\u043a\u0435\u0442\u0430:<\/p>\n<pre><code class=\"r\">options(warn=-1) library(ourpackage) library(optparse)  options = list(   make_option(\"--param1\", help = \"first parameter\"),   make_option(\"--param2\", help = \"second parameter\"),   make_option(\"--param3\", help = \"third parameter\"), )  cli_arguments = parse_args(OptionParser(option_list = options))  generate_report(param1 = cli_arguments$param1,                  param2 = cli_arguments$param2,                  param3 = cli_arguments$param3) <\/code><\/pre>\n<p>\u0412\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u0441\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u043e\u0442\u043b\u0430\u0436\u0438\u0432\u0430\u0442\u044c. \u0423 \u043d\u0430\u0441 \u0447\u0430\u0441\u0442\u044c \u043a\u043e\u0434\u0430 \u043d\u0430 Python, \u0430 \u0447\u0430\u0441\u0442\u044c \u043d\u0430 R. \u041c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/jupyter.org\/hub\" rel=\"noopener noreferrer nofollow\">JupiterHub<\/a>, \u043d\u043e \u043d\u0430\u0448\u0438 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b\u0438 \u0435\u0433\u043e \u0442\u0430\u043a, \u0447\u0442\u043e \u043a\u043e\u0434 \u043d\u0430 Python \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u0432\u044b\u0437\u0432\u0430\u0442\u044c, \u0430 \u0432\u043e\u0442 \u043a\u043e\u0434 \u043d\u0430 R \u043d\u0435\u0442. \u041c\u043e\u0442\u0438\u0432 \u0431\u044b\u043b &#8212; \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432. \u0412 \u0438\u0442\u043e\u0433\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0447\u0435\u0440\u0435\u0437 RStudio. \u0412 \u043d\u0435\u0439 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u0442\u0438\u043f\u0430 Python:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/2f6\/a96\/c28\/2f6a96c28e7289ad3c9d482c2747625c.png\" alt=\"\u0412\u044b\u0437\u043e\u0432 python \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432 RStudio\" title=\"\u0412\u044b\u0437\u043e\u0432 python \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432 RStudio\" width=\"555\" height=\"631\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2f6\/a96\/c28\/2f6a96c28e7289ad3c9d482c2747625c.png\"\/><figcaption>\u0412\u044b\u0437\u043e\u0432 python \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432 RStudio<\/figcaption><\/figure>\n<p>\u0418 \u0443\u0436\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 \u044d\u0442\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e python, \u043a\u043e\u0442\u043e\u0440\u0430\u044f, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0432\u044b\u0437\u043e\u0432\u0435\u0442 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u043e\u0442\u0447\u0435\u0442\u0430 \u043d\u0430 R. <\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0437\u043e\u0432\u0430:<\/p>\n<pre><code class=\"python\">from our_project.workflow.generate_report_one import report_one_executor task = {  \"variables\": {  \"param1\": {\"value\": \"value1\"},  \"param2\": {\"value\":\"value2\"},  \"param3\": {\"value\":\"value3\"}  } } report_one_executor(task)<\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0438 \u043e\u0442\u043b\u0430\u0434\u0438\u0442\u044c \u0441\u0430\u043c R script \u0444\u0430\u0439\u043b, \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0438\u0437 Terminal \u0432 RStudio. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0435\u0433\u043e \u0432\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0432\u043d\u0443\u0442\u0440\u044c \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0445\u043e\u0442\u044f \u0431\u044b \u043d\u0430 \u0432\u0440\u0435\u043c\u044f \u0442\u0435\u0441\u0442\u0430 \u0438 \u043e\u0442\u043b\u0430\u0434\u043a\u0438. \u041c\u043e\u0436\u043d\u043e \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0435\u0433\u043e \u0438 \u0432\u043d\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u044d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0432\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u0435. \u0423 \u043c\u0435\u043d\u044f \u043d\u0435 \u0431\u044b\u043b\u043e \u0442\u0430\u043a\u043e\u0439 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u043b script \u0444\u0430\u0439\u043b \u0432 \u043f\u043e\u0434\u043f\u0430\u043f\u043a\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 R \u043f\u0430\u043f\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0442\u0430\u043a \u043a\u0430\u043a \u0432 \u043f\u0430\u043a\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043f\u043e\u0434\u043f\u0430\u043f\u043e\u043a \u043d\u0435 \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u0438, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u043d\u0435 \u043a\u043e\u043c\u043c\u0438\u0442\u0438\u043b \u044d\u0442\u0443 \u043f\u043e\u043f\u0434\u043f\u0430\u043f\u043a\u0443 \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439. \u041a\u043e\u043c\u0430\u043d\u0434\u0443 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043e\u0442\u0447\u0435\u0442\u0430 \u0447\u0435\u0440\u0435\u0437 script \u043d\u0430\u0434\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u0432 Terminal. \u042d\u0442\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0430 \u043d\u0430 \u043d\u0438\u0436\u043d\u0435\u0439 \u043f\u0430\u043d\u0435\u043b\u0438 \u0432 RStudio.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a30\/05b\/9bb\/a3005b9bb024cc03e59ae7b604ff8756.png\" alt=\"\u0417\u0430\u043f\u0443\u0441\u043a \u0438\u0437 \u043f\u043e\u0434 Terminal\" title=\"\u0417\u0430\u043f\u0443\u0441\u043a \u0438\u0437 \u043f\u043e\u0434 Terminal\" width=\"342\" height=\"104\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a30\/05b\/9bb\/a3005b9bb024cc03e59ae7b604ff8756.png\"\/><figcaption>\u0417\u0430\u043f\u0443\u0441\u043a \u0438\u0437 \u043f\u043e\u0434 Terminal<\/figcaption><\/figure>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0438\u0437 shell:<\/p>\n<pre><code class=\"r\">Rscript R\/reports\/start_script.R \\ --param1=value1 \\ --param2=value2 \\ --param3=value3<\/code><\/pre>\n<p>\u0412 \u043a\u043e\u0434\u0435, \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043e\u0442\u0447\u0435\u0442\u043e\u0432, \u043d\u0430\u0434\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0443\u0442\u044c \u043a RMD \u0444\u0430\u0439\u043b\u0443, \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u0442\u0440\u043e\u0438\u0442\u044c\u0441\u044f \u043e\u0442\u0447\u0435\u0442. \u041f\u0440\u0438\u043c\u0435\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u0442\u0440\u043e\u0438\u0442 \u043e\u0442\u0447\u0435\u0442 \u043d\u0438\u0436\u0435, \u043f\u0440\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u0447\u0442\u043e RMD \u0444\u0430\u0439\u043b \u043b\u0435\u0436\u0438\u0442 \u0432 <strong>inst\/reports<\/strong>:<\/p>\n<pre><code class=\"r\">output_rmd &lt;-   function(output_report_file = \"test\",            output_report_dir = NULL,            output_type = \"DOCX\",            params_list = NULL) {      rmd_file = \"test-report.Rmd\"     report_rmd_folder &lt;- system.file(\"reports\", package = \"myRTestPrj\")     rmd_input &lt;- paste(report_rmd_folder, rmd_file, sep = \"\/\")      rmarkdown::render(       rmd_input,       output_file = output_report_file,       output_dir = output_report_dir,       params = params_list     )   }<\/code><\/pre>\n<h2>2. \u041a\u043e\u043d\u0444\u043b\u0438\u043a\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a<\/h2>\n<p>\u041f\u0440\u0438 \u0441\u0431\u043e\u0440\u043a\u0435 \u043f\u0430\u043a\u0435\u0442\u0430 \u0447\u0430\u0441\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u0430:<\/p>\n<pre><code>replacing previous import \u2018flextable::rotate\u2019 by \u2018ggpubr::rotate\u2019 when loading \u2018our_project\u2019<\/code><\/pre>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0438 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0441\u044f, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u044f\u0432\u043d\u043e \u0434\u043b\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <strong>rotate <\/strong>\u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f <strong>ggpubr::rotate<\/strong>. \u042d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u0430\u0445 \u0435\u0441\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c\u0438 \u0438\u043c\u0435\u043d\u0430\u043c\u0438. \u0427\u0442\u043e\u0431\u044b \u044d\u0442\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043d\u0435 \u0432\u044b\u0432\u043e\u0434\u0438\u043b\u0438\u0441\u044c \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u0430\u043a\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u0437 \u043a\u0430\u043a\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0434\u043e\u043b\u0436\u043d\u044b \u0433\u0440\u0443\u0437\u0438\u0442\u044c\u0441\u044f, \u0430 \u043a\u0430\u043a\u0438\u0435 \u043d\u0435\u0442. \u0423 \u043d\u0430\u0441 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 \u043f\u0430\u043f\u043a\u0435 <strong>R <\/strong>\u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u043d \u0444\u0430\u0439\u043b <strong>global_imports_pkg.R <\/strong>\u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u043b\u0438\u0441\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u044b. <\/p>\n<pre><code class=\"r\"># Global libraries #' @importFrom data.table dcast melt rbindlist #' @import ggplot2 #' @rawNamespace import(ggpubr, except=c(font)) #' @importFrom grDevices rgb colorRampPalette #' @rawNamespace import(huxtable, except=c(add_rownames,theme_grey)) NULL<\/code><\/pre>\n<p>\u041d\u043e \u044d\u0442\u043e \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0434\u0440\u0443\u0433\u043e\u0439, \u0431\u043e\u043b\u0435\u0435 \u043a\u043e\u0432\u0430\u0440\u043d\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0435. \u041f\u0443\u0441\u0442\u044c \u0443 \u0432\u0430\u0441 \u0432  <strong>global_imports_pkg.R<\/strong> \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e \u0442\u0430\u043a: <\/p>\n<pre><code class=\"r\">#' @importFrom data.table melt rbindlist<\/code><\/pre>\n<p>\u0410 \u0432 \u043a\u043e\u0434\u0435 \u0432\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <strong>dcast<\/strong>, \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0435\u0442 \u0432 \u0441\u0442\u0440\u043e\u0447\u043a\u0435 \u0432\u044b\u0448\u0435. \u0415\u0441\u043b \u0432\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0435\u0442\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0438\u0437 \u043f\u043e\u0434 RStudio, \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0432 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b7b\/deb\/cf3\/b7bdebcf3922ccdcfec8f68c3188bf7d.png\" alt=\"\u0417\u0430\u043f\u0443\u0441\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 RStudio\" title=\"\u0417\u0430\u043f\u0443\u0441\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 RStudio\" width=\"390\" height=\"161\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b7b\/deb\/cf3\/b7bdebcf3922ccdcfec8f68c3188bf7d.png\"\/><figcaption>\u0417\u0430\u043f\u0443\u0441\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 RStudio<\/figcaption><\/figure>\n<p>\u0423 \u0432\u0430\u0441 \u0432\u0441\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u0442\u0430\u043a \u043a\u0430\u043a \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0432\u044b \u0441\u0435\u0431\u0435 \u0438\u043d\u0441\u0442\u0430\u043b\u043b\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0432\u0435\u0441\u044c \u043f\u0430\u043a\u0435\u0442 <strong>data.table<\/strong>, \u0430 \u0432\u043e\u0442 \u043f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u044d\u0442\u0443 \u0436\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0438\u0437 Python, \u0443 \u0432\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0430, \u0442\u0430\u043a \u043a\u0430\u043a \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0443 \u0432\u0430\u0441 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e, \u0447\u0442\u043e \u0432 \u043d\u0430\u0448 \u043f\u0430\u043a\u0435\u0442 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0434\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e 2 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u0437 <strong>data.table <\/strong>&#8212; \u044d\u0442\u043e <strong>melt<\/strong> \u0438 <strong>rbindlist<\/strong>. \u0422\u0443 \u0436\u0435 \u043e\u0448\u0438\u0431\u043a\u0443 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u0445\u043e\u0442\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0432\u0441\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c. <\/p>\n<p>\u041f\u043e\u0445\u043e\u0436\u0435\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043a \u0436\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c, \u0435\u0441\u043b\u0438 \u0437\u0430\u0431\u044b\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0432\u0430\u043c\u0438 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0439 \u043f\u0430\u043a\u0435\u0442 \u0432 \u0444\u0430\u0439\u043b <strong>DESCRIPTION<\/strong>:<\/p>\n<pre><code class=\"r\">... Imports:     highcharter,     statnet.common,     hablar Suggests:     devtools, ...<\/code><\/pre>\n<p>\u041f\u0440\u0438 \u0437\u0430\u043f\u043a\u0443\u0441\u043a\u0435 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0432 RStudio \u0432\u0441\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u0442\u0430\u043a \u043a\u0430\u043a \u0432\u044b \u044f\u0432\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438 \u044d\u0442\u043e\u0442 \u043f\u0430\u043a\u0435\u0442 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e, \u043d\u043e \u0432\u043e\u0442 \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0430\u043a\u0435\u0442\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u043c \u043a\u043e\u0434\u043e\u043c \u0438\u043b\u0438 \u0441\u0440\u0435\u0434\u043e\u0439 \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u043e\u0448\u0438\u0431\u043a\u0443. <\/p>\n<h2>3. \u0423\u0442\u0435\u0447\u043a\u0430 \u043f\u0430\u043c\u044f\u0442\u0438 \u0432 Rmarkdown::render<\/h2>\n<p>\u041f\u0440\u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043e\u0442\u0447\u0435\u043e\u0432 \u0432 PDF \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0430, \u0435\u0441\u043b\u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 \u043d\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u0430, \u0442\u043e \u0432\u0438\u0434\u043d\u043e \u043a\u0430\u043a \u043e\u043d \u043e\u0442\u044a\u0435\u0434\u0430\u0435\u0442 \u0432\u0441\u044e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c \u0438 \u043f\u0430\u0434\u0430\u0435\u0442. \u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043c\u044b \u0440\u0435\u0437\u0430\u043b\u0438 \u043e\u0442\u0447\u0435\u0442 \u043d\u0430 \u0447\u0430\u0441\u0442\u0438 \u0438 \u043f\u043e\u0442\u043e\u043c \u0438\u0445 \u0441\u043a\u043b\u0435\u0438\u0432\u0430\u043b\u0438. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 <a href=\"https:\/\/www.rdocumentation.org\/packages\/qpdf\/versions\/1.2.0\/topics\/qpdf\" rel=\"noopener noreferrer nofollow\">qpdf::pdf_combine<\/a>. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0441 \u0443\u0442\u0435\u0447\u043a\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u043e\u0431\u0441\u0443\u0436\u0434\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c <a href=\"https:\/\/stackoverflow.com\/questions\/39319558\/pandoc-rstudio-knitr-memory-leak\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>. \u041a\u0430\u043a\u043e\u0433\u043e-\u0442\u043e \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043d\u0430\u0439\u0442\u0438 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c, \u0445\u043e\u0442\u044f \u0441\u0438\u043b \u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0431\u044b\u043b\u043e \u043f\u043e\u0442\u0440\u0430\u0447\u0435\u043d\u043d\u043e \u043d\u0435\u043c\u0430\u043b\u043e.<\/p>\n<h2>4. Latex<\/h2>\n<p>\u0414\u043b\u044f \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f pdf \u043e\u0442\u0447\u0435\u0442\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 <a href=\"https:\/\/www.latex-project.org\/\" rel=\"noopener noreferrer nofollow\">Latex<\/a>. \u041d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d \u0434\u043b\u044f \u043e\u0442\u0447\u0435\u0442\u0430 \u0431\u044b\u043b \u0432\u0437\u044f\u0442 <a href=\"https:\/\/github.com\/iandol\/dotpandoc\/blob\/master\/templates\/custom.latex\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>. <\/p>\n<p>\u041a\u043e\u0434 \u043d\u0430 R \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043e\u0442\u0447\u0435\u0442\u0430 \u0441 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u043c Latex:<\/p>\n<pre><code class=\"r\">  rmarkdown::render(     rmd_input,     output_format = \"pdf_document\",     output_file = output_file,     output_dir = output_report_dir,     params = params,     output_options = list(       template = paste0(report_rmd_folder,                         \"\/assets\/custom.latex\"),       clean = TRUE     )   )<\/code><\/pre>\n<p>\u0422\u0430\u043a \u0436\u0435 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 \u0448\u0430\u043f\u043a\u0443 RMD \u0444\u0430\u0439\u043b\u0430 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043b\u044f \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430:<\/p>\n<pre><code class=\"r\">--- title: header-includes:   \\usepackage{graphicx}   \\usepackage{fancyhdr}   \\pagestyle{fancy}   \\color{ecbdarkblue}   \\color{ecbbgr}    % Head    \\fancyhead[C]{}   \\fancyhead[L]{}   \\fancyhead[R]{}    % Remove header line    \\renewcommand{\\headrulewidth}{0pt}    % Page margins    \\usepackage{geometry}   \\geometry{    a4paper,    left=30px,    top=10mm,    headsep=5mm,    right=50px    }    % Titles    \\usepackage{titlesec}   \\titlespacing\\section{0mm}{7pt plus 4pt minus 2pt}{28pt plus 2pt minus 2pt}   \\titlespacing\\subsection{6mm}{-7pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}   \\titlespacing\\subsubsection{6mm}{12pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}    % Section and subsection titles    \\sectionfont{\\fontfamily{phv}\\selectfont\\LARGE\\bfseries\\color{ecbdarkblue}}   \\subsectionfont{\\fontfamily{phv}\\selectfont\\normalsize\\mdseries\\color{white}}   \\subsubsectionfont{\\fontfamily{phv}\\selectfont\\scriptsize\\mdseries\\color{white}}   \\color{black}    % Line spacing    \\usepackage{setspace}   \\setstretch{0.6}    % Section color    \\usepackage{xcolor}   \\usepackage{framed}   \\colorlet{shadecolor}{ecbbgr}    % Footer    \\fancyfootoffset[R]{-2mm}   \\renewcommand{\\footrulewidth}{0.4pt}\\color{ecbdarkblue}   \\rfoot{\\vspace{0.5mm}\\Large\\color{ecbdarkblue}\\colorbox{ecbbgr}{ S \\color{white}\\thepage}}   \\cfoot{\\vspace{0.01mm}\\scriptsize\\bfseries\\hspace{420px} ECB \\\\ \\scriptsize\\bfseries\\color{black}\\hspace{390px} DG-S\/EA\/GBS\\\\  \\scriptsize\\bfseries\\color{ecbdarkblue}\\hspace{395px} `r format(Sys.Date(), format=\"%d %b %Y\")`}   \\lfoot{} output:   pdf_document:     keep_md: no     keep_tex: no     latex_engine: pdflatex     number_sections: false --- ```{r setup, include=FALSE} # some code here... ```<\/code><\/pre>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u044b Latex \u044f \u043d\u0435 \u0431\u0443\u0434\u0443 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c, \u0442\u0430\u043a \u043a\u0430\u043a \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u043a\u043e\u0434 \u0432 \u0442\u0435\u0445 \u0438\u043b\u0438 \u0438\u043d\u044b\u0445 \u0431\u043b\u043e\u043a\u0430\u0445 \u0438 \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a \u043d\u0430\u0434\u043e \u0435\u0433\u043e \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435. \u0412\u043e \u043c\u043d\u043e\u0433\u043e\u043c \u044f \u043e\u043f\u0438\u0440\u0430\u043b\u0441\u044f \u043d\u0430 <a href=\"https:\/\/www.overleaf.com\/learn\" rel=\"noopener noreferrer nofollow\">\u044d\u0442\u043e\u0442 \u0441\u0430\u0439\u0442<\/a> \u043a\u043e\u0433\u0434\u0430 \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043b \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442.<\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u0442\u0430\u043a \u0436\u0435 \u0433\u0438\u0431\u043a\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043a\u0430\u043a\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0443\u0442 \u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u0432 \u043e\u0442\u0447\u0435\u0442. \u042d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439: <\/p>\n<pre><code class=\"r\">knitr::opts_chunk$set(echo = FALSE,                       warning = FALSE,                       message = FALSE,                       error = TRUE)<\/code><\/pre>\n<p>\u041c\u043e\u0436\u043d\u043e \u044d\u0442\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0442\u0430\u043a \u0436\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0432 \u0448\u0430\u043f\u043a\u0435 chunk:<\/p>\n<pre><code class=\"r\">```{r our_chunk, eval = TRUE, results='asis', echo=FALSE, warning=FALSE, message=FALSE, error=TRUE}<\/code><\/pre>\n<h2>5. \u0417\u0430\u0433\u043b\u0443\u0448\u043a\u0438 \u0434\u043b\u044f \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u043f\u0440\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 Unit \u0442\u0435\u0441\u0442\u043e\u0432<\/h2>\n<p>\u0414\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u0432\u0443\u043d\u043a\u0446\u0438\u0439 \u0438\u0437 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 Python  \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 <strong>reticulate<\/strong>. <\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0437\u043e\u0432\u0430 \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<pre><code class=\"r\">get_python_func &lt;- function(param1) {   pm &lt;- reticulate::import(\"our_project.core.python_functions\")   return(pm$get_python_func(param1)) }<\/code><\/pre>\n<p>\u0422\u0435\u0441\u0442 &#8212; \u0437\u0430\u0433\u043b\u0443\u0448\u043a\u0430 \u0434\u043b\u044f \u0442\u0430\u043a\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<pre><code class=\"r\">test_that(\"get_python_func\", {   stub(get_python_func, \"reticulate::import\", list(get_python_func = function(...) TRUE))   res &lt;- get_python_func(param1 = \"value1\")   expect_equal(res, TRUE) })<\/code><\/pre>\n<h2>6. \u041e\u0442\u043b\u0430\u0434\u043a\u0430 \u043a\u043e\u0434\u0430<\/h2>\n<p>\u041f\u0440\u0438 \u043e\u0442\u043b\u0430\u0434\u043a\u0435 \u043a\u043e\u0434\u0430 \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0443\u044e \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u0443\u044e \u043d\u0430\u043c \u0447\u0430\u0441\u0442\u044c \u043a\u043e\u0434\u0430 \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u0434\u0430. <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ea8\/8df\/4f6\/ea88df4f628dfb7c5585ee76d8abef0e.png\" alt=\"\u041e\u0442\u043b\u0430\u0434\u043a\u0430 \u043d\u0430 R\" title=\"\u041e\u0442\u043b\u0430\u0434\u043a\u0430 \u043d\u0430 R\" width=\"1900\" height=\"512\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ea8\/8df\/4f6\/ea88df4f628dfb7c5585ee76d8abef0e.png\"\/><figcaption>\u041e\u0442\u043b\u0430\u0434\u043a\u0430 \u043d\u0430 R<\/figcaption><\/figure>\n<p>\u041d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435 \u0432\u044b\u0448\u0435 \u0432 \u0432\u0435\u0440\u0445\u043d\u0435\u043c \u043f\u0440\u0430\u0432\u043e\u043c \u0443\u0433\u043b\u0443 \u0432 \u043f\u043e\u043b\u0435 Data \u0435\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f df. \u0427\u0442\u043e\u0431\u044b \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0451 \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0443\u044e \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043d\u0430\u0434\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432 Console:<\/p>\n<pre><code class=\"r\">assign(\"df\", value = df, envir = .GlobalEnv)<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/8b2\/78b\/617\/8b278b61769fe5f2584bdd4a5d663d10.png\" alt=\"\u041a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435\" title=\"\u041a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435\" width=\"573\" height=\"253\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8b2\/78b\/617\/8b278b61769fe5f2584bdd4a5d663d10.png\"\/><figcaption>\u041a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435<\/figcaption><\/figure>\n<p>\u0418 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u044d\u0442\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 &#8212; \u043d\u0430\u0436\u0430\u0442\u044c <strong>ENTER<\/strong>.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u0442\u043e\u0442 \u043a\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u044d\u0442\u043e\u0439 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0435\u0433\u043e &#8212; <strong>CTRL+ENTER<\/strong>.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/941\/cb3\/e07\/941cb3e072b26462bdef32a1d5ff091f.png\" alt=\"\u0417\u0430\u043f\u0443\u0441\u043a \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430 \u043a\u043e\u0434\u0430 \u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \" title=\"\u0417\u0430\u043f\u0443\u0441\u043a \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430 \u043a\u043e\u0434\u0430 \u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \" width=\"421\" height=\"204\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/941\/cb3\/e07\/941cb3e072b26462bdef32a1d5ff091f.png\"\/><figcaption>\u0417\u0430\u043f\u0443\u0441\u043a \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430 \u043a\u043e\u0434\u0430 \u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <\/figcaption><\/figure>\n<p> \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u0442\u043b\u0430\u0434\u043a\u0430 \u0432 RMD \u0444\u0430\u0439\u043b\u0435 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0438 \u0432\u0441\u044f \u043b\u043e\u0433\u0438\u043a\u0430 \u043f\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0432\u044b\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u0444\u0430\u0439\u043b\u0430\u0445 <strong>*.R<\/strong>. \u041a \u044d\u0442\u043e\u043c\u0443 \u0435\u0449\u0451 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435 \u0432\u044b\u0441\u043e\u043a\u0430\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043e\u0442\u0447\u0435\u0442\u043e\u0432 \u0438\u0437 RMD \u0444\u0430\u0439\u043b\u0430. \u0412 \u0442\u0430\u043a\u0438\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0434\u0435\u043b\u0430\u0442\u044c <strong>DEBUG <\/strong>\u043d\u0435 \u0443\u0434\u043e\u0431\u043d\u043e. \u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432\u0441\u0435 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e \u0438 \u0443\u0447\u0430\u0441\u0442\u043a\u0438 \u043a\u043e\u0434\u0430 \u0432 <strong>RMD<\/strong> \u043d\u0435 \u043e\u0442\u043b\u0430\u0434\u0438\u0442\u044c. \u0410 \u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u043e\u0439 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043b\u044e\u0431\u043e\u0439 \u0443\u0447\u0430\u0441\u0442\u043e\u043a \u043a\u043e\u0434\u0430, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043e\u043d \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 <strong>RMD<\/strong> \u0444\u0430\u0439\u043b\u0435.<\/p>\n<h2>7. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435<\/h2>\n<p>\u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 <a href=\"https:\/\/www.rdocumentation.org\/packages\/methods\/versions\/3.6.2\/topics\/ReferenceClasses\" rel=\"noopener noreferrer nofollow\">ReferenceClasses<\/a>, \u0440\u0435\u0448\u0438\u0432, \u0447\u0442\u043e \u043e\u043d\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u043d\u0430\u043c  \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0442. \u041f\u0440\u0430\u0432\u0434\u0430, \u0438\u0445 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043b\u0430\u0434\u0438\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 RStudio. \u041d\u043e \u0435\u0441\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u0442\u043b\u0430\u0434\u043a\u0438, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u0430\u043c\u0430 \u043e\u0442\u043b\u0430\u0434\u043a\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430:<\/p>\n<pre><code class=\"r\">s$trace(class_method, browser) s$untrace(class_method, browser) debug(s$class_method)<\/code><\/pre>\n<p>\u0413\u0434\u0435 s &#8212; \u044d\u0442\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043b\u0430\u0441\u0441\u0430, \u0430 class_method &#8212; \u044d\u0442\u043e \u043c\u0435\u0442\u043e\u0434 \u043a\u043b\u0430\u0441\u0441\u0430. \u041d\u043e \u043e\u043d \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u044b\u043c \u0438 \u043c\u044b \u043e\u0442\u043b\u0430\u0436\u0438\u0432\u0430\u043b\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438.<\/p>\n<h2>8. \u041f\u0440\u043e\u0447\u0438\u0435 \u043d\u044e\u0430\u043d\u0441\u044b \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/h2>\n<ul>\n<li>\n<p>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0434\u043b\u044f \u043e\u0442\u0447\u0435\u0442\u043e\u0432 &#8212; <a href=\"https:\/\/dplyr.tidyverse.org\/\" rel=\"noopener noreferrer nofollow\">dplyr<\/a><\/p>\n<\/li>\n<li>\n<p>\u0427\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u0437 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"r\"># create list with input parameters params &lt;- c(as.list(environment()))<\/code><\/pre>\n<ul>\n<li>\n<p>\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438\u043b\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0438\u0437 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b <a href=\"https:\/\/astrostatistics.psu.edu\/su07\/R\/html\/base\/html\/rm.html\" rel=\"noopener noreferrer nofollow\">rm<\/a><\/p>\n<\/li>\n<li>\n<p>\u0421\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043a\u043e\u0434\u0430 &#8212; <a href=\"https:\/\/astrostatistics.psu.edu\/su07\/R\/html\/base\/html\/rm.html\" rel=\"noopener noreferrer nofollow\">lintr<\/a><\/p>\n<\/li>\n<li>\n<p>\u0414\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0432 Confluence \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <a href=\"https:\/\/cran.r-project.org\/web\/packages\/conflr\/index.html\" rel=\"noopener noreferrer nofollow\">conflr<\/a><\/p>\n<\/li>\n<li>\n<p>\u0422\u0430\u0431\u043b\u0438\u0446\u044b \u0432 \u043e\u0442\u0447\u0435\u0442\u0430\u0445 \u0434\u0435\u043b\u0430\u043b\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/cran.r-project.org\/web\/packages\/flextable\/index.html\" rel=\"noopener noreferrer nofollow\">felxtable<\/a><\/p>\n<\/li>\n<\/ul>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u042d\u0442\u043e \u0441\u0442\u0430\u0442\u044c\u044f &#8212; \u043f\u0430\u043c\u044f\u0442\u043a\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u044f \u043e\u043f\u0438\u0441\u0430\u043b \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0432\u0435\u0449\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u043d\u0435 \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u0437\u0430\u0431\u044b\u0442\u044c \u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0435, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u0431\u044b\u043b\u0438 \u0431\u044b \u043f\u043e\u043b\u0435\u0437\u043d\u044b \u0442\u0435\u043c, \u043a\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u043c\u0438 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 R. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0447\u0442\u043e-\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c, \u0430 \u0447\u0435\u0433\u043e-\u0442\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c, \u043d\u043e \u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b &#171;\u0418\u0437\u043e\u0431\u0440\u0435\u0442\u0430\u0442\u044c \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434 \u0437\u0430\u043d\u043e\u0432\u043e&#187;, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 R. \u0412 \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u043f\u043e\u0436\u0435\u043b\u0430\u0442\u044c \u0432\u0441\u0435\u043c \u0443\u0441\u043f\u0435\u0445\u043e\u0432, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0445\u043e\u0440\u043e\u0448\u0438\u0445 \u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/691938\/\"> https:\/\/habr.com\/ru\/post\/691938\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u0445\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u044f \u043f\u0438\u0441\u0430\u043b \u043e\u0442\u0447\u0435\u0442\u044b \u043d\u0430 R, \u0441 \u0447\u0435\u043c \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0441\u044f \u0438 \u043a\u0430\u043a \u0440\u0435\u0448\u0430\u043b \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u043b\u0438 \u043f\u043e \u0445\u043e\u0434\u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u041e\u0442\u0447\u0435\u0442\u044b \u0431\u044b\u043b\u0438 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 PDF \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u0438\u0441\u044c \u0438\u0437 Python \u0432 Camunda. <\/p>\n<h2>1. \u0417\u0430\u043f\u0443\u0441\u043a \u043e\u0442\u0447\u0435\u0442\u043e\u0432 \u043d\u0430 R<\/h2>\n<p>\u041f\u0435\u0440\u0432\u043e\u0435, \u0441 \u0447\u0435\u043c \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u0442\u044c\u0441\u044f &#8212; \u044d\u0442\u043e \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u043e\u0442\u0447\u0435\u0442\u043e\u0432 \u043d\u0430 R \u0438\u0437 Python. \u0422\u043e\u0447\u043d\u0435\u0435 \u0438\u0437 Python \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u0438 <strong>subprocess.Popen<\/strong>,<strong> <\/strong>\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b R script. R script, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b \u043e\u0434\u043d\u0443 \u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0442\u043e\u0433\u043e \u0438\u043b\u0438 \u0438\u043d\u043e\u0433\u043e \u043e\u0442\u0447\u0435\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u044b\u043b\u0430 \u0447\u0430\u0441\u0442\u044c\u044e \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u0430\u043a \u043f\u0430\u043a\u0435\u0442 \u043d\u0430 R. \u0420\u0430\u0437\u043d\u0438\u0446\u0443 \u043c\u0435\u0436\u0434\u0443 \u043f\u0430\u043a\u0435\u0442\u043e\u043c \u0438 \u043e\u0431\u044b\u0447\u043d\u044b\u043c\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u043c\u0438 \u043d\u0430 R \u044f \u043e\u043f\u0438\u0441\u0430\u043b \u0442\u0443\u0442 &#8212; <a href=\"https:\/\/habr.com\/ru\/company\/deutschetelekomitsolutions\/blog\/548262\/\" rel=\"noopener noreferrer nofollow\">\u0441\u0441\u044b\u043b\u043a\u0430<\/a>. \u041c\u043e\u0436\u043d\u043e \u0441\u0440\u0430\u0437\u0443 \u0434\u0435\u0440\u0433\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 R \u0438 \u043c\u043e\u0439 \u043a\u043e\u043b\u043b\u0435\u0433\u0430 \u043f\u044b\u0442\u0430\u043b\u0441\u044f \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u0432\u044b\u0437\u043e\u0432 \u043e\u0442\u0447\u0435\u0442\u043e\u0432 \u0438\u0437 Python, \u043d\u043e \u0442\u043e \u043b\u0438 \u0438\u0437-\u0437\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435\u043c \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u0442\u043e \u043b\u0438 \u0438\u0437-\u0437\u0430 Camunda, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u044d\u0442\u043e \u0432\u0441\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u043e\u0441\u044c, \u0442\u0430\u043a\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e, \u043d\u043e \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u043d\u0430 \u043d\u0430\u0448\u0435\u043c \u0431\u043e\u0435\u0432\u043e\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438. \u041c\u0438\u043d\u0443\u0441\u043e\u043c \u0436\u0435 \u0432\u044b\u0437\u043e\u0432\u0430 R \u0447\u0435\u0440\u0435\u0437 <strong>subprocess.Popen <\/strong>\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u043e, \u0447\u0442\u043e Python \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 R \u0441\u043a\u0440\u0438\u043f\u0442 \u0447\u0435\u0440\u0435\u0437 shell, \u0430 \u0443\u0436\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 \u044d\u0442\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0434\u0435\u0440\u0433\u0430\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0430\u043a\u0435\u0442\u0430 R. <\/p>\n<figure class=\"full-width\"><figcaption>\u0417\u0430\u043f\u0443\u0441\u043a \u043e\u0442\u0447\u0435\u0442\u0430 \u0447\u0435\u0440\u0435\u0437 R script \u0444\u0430\u0439\u043b<\/figcaption><\/figure>\n<p>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0434\u043b\u044f \u043e\u0442\u0447\u0435\u0442\u0430 \u0442\u043e\u0436\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 shell \u0438 \u0443\u0436\u0435 \u0432 R script \u0444\u0430\u0439\u043b\u0435 \u0442\u0430\u043a \u0436\u0435 \u0438\u0445 \u0447\u0438\u0442\u0430\u0442\u044c \u043a\u0430\u043a \u0431\u0443\u0434\u044c \u0442\u043e \u0438\u0445 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442 \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443. <\/p>\n<p>\u0427\u0430\u0441\u0442\u044c \u043a\u043e\u0434\u0430 \u043d\u0430 Python: <\/p>\n<pre><code class=\"python\">parameters = {             \"param1\": param1,             \"param2\": param2,             \"param3\": param3         } ...  command_list = [\"Rscript\", path_to_r_script] + [f\"--{key}={value}\" for key, value in parameters.items()]  with subprocess.Popen(   command_list, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=work_dir ) as sub_prc_response:   stdout, stderr = sub_prc_response.communicate()   return_code = sub_prc_response.returncode <\/code><\/pre>\n<p>Script \u043d\u0430 R, \u0433\u0434\u0435 <strong>ourpackage <\/strong>\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0430\u043a\u0435\u0442\u0430:<\/p>\n<pre><code class=\"r\">options(warn=-1) library(ourpackage) library(optparse)  options = list(   make_option(\"--param1\", help = \"first parameter\"),   make_option(\"--param2\", help = \"second parameter\"),   make_option(\"--param3\", help = \"third parameter\"), )  cli_arguments = parse_args(OptionParser(option_list = options))  generate_report(param1 = cli_arguments$param1,                  param2 = cli_arguments$param2,                  param3 = cli_arguments$param3) <\/code><\/pre>\n<p>\u0412\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u0441\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u043e\u0442\u043b\u0430\u0436\u0438\u0432\u0430\u0442\u044c. \u0423 \u043d\u0430\u0441 \u0447\u0430\u0441\u0442\u044c \u043a\u043e\u0434\u0430 \u043d\u0430 Python, \u0430 \u0447\u0430\u0441\u0442\u044c \u043d\u0430 R. \u041c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/jupyter.org\/hub\" rel=\"noopener noreferrer nofollow\">JupiterHub<\/a>, \u043d\u043e \u043d\u0430\u0448\u0438 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b\u0438 \u0435\u0433\u043e \u0442\u0430\u043a, \u0447\u0442\u043e \u043a\u043e\u0434 \u043d\u0430 Python \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u0432\u044b\u0437\u0432\u0430\u0442\u044c, \u0430 \u0432\u043e\u0442 \u043a\u043e\u0434 \u043d\u0430 R \u043d\u0435\u0442. \u041c\u043e\u0442\u0438\u0432 \u0431\u044b\u043b &#8212; \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432. \u0412 \u0438\u0442\u043e\u0433\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0447\u0435\u0440\u0435\u0437 RStudio. \u0412 \u043d\u0435\u0439 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u0442\u0438\u043f\u0430 Python:<\/p>\n<figure class=\"full-width\"><figcaption>\u0412\u044b\u0437\u043e\u0432 python \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432 RStudio<\/figcaption><\/figure>\n<p>\u0418 \u0443\u0436\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 \u044d\u0442\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e python, \u043a\u043e\u0442\u043e\u0440\u0430\u044f, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0432\u044b\u0437\u043e\u0432\u0435\u0442 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u043e\u0442\u0447\u0435\u0442\u0430 \u043d\u0430 R. <\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0437\u043e\u0432\u0430:<\/p>\n<pre><code class=\"python\">from our_project.workflow.generate_report_one import report_one_executor task = {  \"variables\": {  \"param1\": {\"value\": \"value1\"},  \"param2\": {\"value\":\"value2\"},  \"param3\": {\"value\":\"value3\"}  } } report_one_executor(task)<\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0438 \u043e\u0442\u043b\u0430\u0434\u0438\u0442\u044c \u0441\u0430\u043c R script \u0444\u0430\u0439\u043b, \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0438\u0437 Terminal \u0432 RStudio. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0435\u0433\u043e \u0432\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0432\u043d\u0443\u0442\u0440\u044c \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0445\u043e\u0442\u044f \u0431\u044b \u043d\u0430 \u0432\u0440\u0435\u043c\u044f \u0442\u0435\u0441\u0442\u0430 \u0438 \u043e\u0442\u043b\u0430\u0434\u043a\u0438. \u041c\u043e\u0436\u043d\u043e \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0435\u0433\u043e \u0438 \u0432\u043d\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u044d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0432\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u0435. \u0423 \u043c\u0435\u043d\u044f \u043d\u0435 \u0431\u044b\u043b\u043e \u0442\u0430\u043a\u043e\u0439 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u043b script \u0444\u0430\u0439\u043b \u0432 \u043f\u043e\u0434\u043f\u0430\u043f\u043a\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 R \u043f\u0430\u043f\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0442\u0430\u043a \u043a\u0430\u043a \u0432 \u043f\u0430\u043a\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043f\u043e\u0434\u043f\u0430\u043f\u043e\u043a \u043d\u0435 \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u0438, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u043d\u0435 \u043a\u043e\u043c\u043c\u0438\u0442\u0438\u043b \u044d\u0442\u0443 \u043f\u043e\u043f\u0434\u043f\u0430\u043f\u043a\u0443 \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439. \u041a\u043e\u043c\u0430\u043d\u0434\u0443 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043e\u0442\u0447\u0435\u0442\u0430 \u0447\u0435\u0440\u0435\u0437 script \u043d\u0430\u0434\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u0432 Terminal. \u042d\u0442\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0430 \u043d\u0430 \u043d\u0438\u0436\u043d\u0435\u0439 \u043f\u0430\u043d\u0435\u043b\u0438 \u0432 RStudio.<\/p>\n<figure class=\"\"><figcaption>\u0417\u0430\u043f\u0443\u0441\u043a \u0438\u0437 \u043f\u043e\u0434 Terminal<\/figcaption><\/figure>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0438\u0437 shell:<\/p>\n<pre><code class=\"r\">Rscript R\/reports\/start_script.R \\ --param1=value1 \\ --param2=value2 \\ --param3=value3<\/code><\/pre>\n<p>\u0412 \u043a\u043e\u0434\u0435, \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043e\u0442\u0447\u0435\u0442\u043e\u0432, \u043d\u0430\u0434\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0443\u0442\u044c \u043a RMD \u0444\u0430\u0439\u043b\u0443, \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u0442\u0440\u043e\u0438\u0442\u044c\u0441\u044f \u043e\u0442\u0447\u0435\u0442. \u041f\u0440\u0438\u043c\u0435\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u0442\u0440\u043e\u0438\u0442 \u043e\u0442\u0447\u0435\u0442 \u043d\u0438\u0436\u0435, \u043f\u0440\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u0447\u0442\u043e RMD \u0444\u0430\u0439\u043b \u043b\u0435\u0436\u0438\u0442 \u0432 <strong>inst\/reports<\/strong>:<\/p>\n<pre><code class=\"r\">output_rmd &lt;-   function(output_report_file = \"test\",            output_report_dir = NULL,            output_type = \"DOCX\",            params_list = NULL) {      rmd_file = \"test-report.Rmd\"     report_rmd_folder &lt;- system.file(\"reports\", package = \"myRTestPrj\")     rmd_input &lt;- paste(report_rmd_folder, rmd_file, sep = \"\/\")      rmarkdown::render(       rmd_input,       output_file = output_report_file,       output_dir = output_report_dir,       params = params_list     )   }<\/code><\/pre>\n<h2>2. \u041a\u043e\u043d\u0444\u043b\u0438\u043a\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a<\/h2>\n<p>\u041f\u0440\u0438 \u0441\u0431\u043e\u0440\u043a\u0435 \u043f\u0430\u043a\u0435\u0442\u0430 \u0447\u0430\u0441\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u0430:<\/p>\n<pre><code>replacing previous import \u2018flextable::rotate\u2019 by \u2018ggpubr::rotate\u2019 when loading \u2018our_project\u2019<\/code><\/pre>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0438 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0441\u044f, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u044f\u0432\u043d\u043e \u0434\u043b\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <strong>rotate <\/strong>\u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f <strong>ggpubr::rotate<\/strong>. \u042d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u0430\u0445 \u0435\u0441\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c\u0438 \u0438\u043c\u0435\u043d\u0430\u043c\u0438. \u0427\u0442\u043e\u0431\u044b \u044d\u0442\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043d\u0435 \u0432\u044b\u0432\u043e\u0434\u0438\u043b\u0438\u0441\u044c \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u0430\u043a\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u0437 \u043a\u0430\u043a\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0434\u043e\u043b\u0436\u043d\u044b \u0433\u0440\u0443\u0437\u0438\u0442\u044c\u0441\u044f, \u0430 \u043a\u0430\u043a\u0438\u0435 \u043d\u0435\u0442. \u0423 \u043d\u0430\u0441 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 \u043f\u0430\u043f\u043a\u0435 <strong>R <\/strong>\u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u043d \u0444\u0430\u0439\u043b <strong>global_imports_pkg.R <\/strong>\u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u043b\u0438\u0441\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u044b. <\/p>\n<pre><code class=\"r\"># Global libraries #' @importFrom data.table dcast melt rbindlist #' @import ggplot2 #' @rawNamespace import(ggpubr, except=c(font)) #' @importFrom grDevices rgb colorRampPalette #' @rawNamespace import(huxtable, except=c(add_rownames,theme_grey)) NULL<\/code><\/pre>\n<p>\u041d\u043e \u044d\u0442\u043e \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0434\u0440\u0443\u0433\u043e\u0439, \u0431\u043e\u043b\u0435\u0435 \u043a\u043e\u0432\u0430\u0440\u043d\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0435. \u041f\u0443\u0441\u0442\u044c \u0443 \u0432\u0430\u0441 \u0432  <strong>global_imports_pkg.R<\/strong> \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e \u0442\u0430\u043a: <\/p>\n<pre><code class=\"r\">#' @importFrom data.table melt rbindlist<\/code><\/pre>\n<p>\u0410 \u0432 \u043a\u043e\u0434\u0435 \u0432\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <strong>dcast<\/strong>, \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0435\u0442 \u0432 \u0441\u0442\u0440\u043e\u0447\u043a\u0435 \u0432\u044b\u0448\u0435. \u0415\u0441\u043b \u0432\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0435\u0442\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0438\u0437 \u043f\u043e\u0434 RStudio, \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0432 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438:<\/p>\n<figure class=\"\"><figcaption>\u0417\u0430\u043f\u0443\u0441\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 RStudio<\/figcaption><\/figure>\n<p>\u0423 \u0432\u0430\u0441 \u0432\u0441\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u0442\u0430\u043a \u043a\u0430\u043a \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0432\u044b \u0441\u0435\u0431\u0435 \u0438\u043d\u0441\u0442\u0430\u043b\u043b\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0432\u0435\u0441\u044c \u043f\u0430\u043a\u0435\u0442 <strong>data.table<\/strong>, \u0430 \u0432\u043e\u0442 \u043f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u044d\u0442\u0443 \u0436\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0438\u0437 Python, \u0443 \u0432\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0430, \u0442\u0430\u043a \u043a\u0430\u043a \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0443 \u0432\u0430\u0441 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e, \u0447\u0442\u043e \u0432 \u043d\u0430\u0448 \u043f\u0430\u043a\u0435\u0442 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0434\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e 2 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u0437 <strong>data.table <\/strong>&#8212; \u044d\u0442\u043e <strong>melt<\/strong> \u0438 <strong>rbindlist<\/strong>. \u0422\u0443 \u0436\u0435 \u043e\u0448\u0438\u0431\u043a\u0443 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u0445\u043e\u0442\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0432\u0441\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c. <\/p>\n<p>\u041f\u043e\u0445\u043e\u0436\u0435\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043a \u0436\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c, \u0435\u0441\u043b\u0438 \u0437\u0430\u0431\u044b\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0432\u0430\u043c\u0438 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0439 \u043f\u0430\u043a\u0435\u0442 \u0432 \u0444\u0430\u0439\u043b <strong>DESCRIPTION<\/strong>:<\/p>\n<pre><code class=\"r\">... Imports:     highcharter,     statnet.common,     hablar Suggests:     devtools, ...<\/code><\/pre>\n<p>\u041f\u0440\u0438 \u0437\u0430\u043f\u043a\u0443\u0441\u043a\u0435 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0432 RStudio \u0432\u0441\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u0442\u0430\u043a \u043a\u0430\u043a \u0432\u044b \u044f\u0432\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438 \u044d\u0442\u043e\u0442 \u043f\u0430\u043a\u0435\u0442 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e, \u043d\u043e \u0432\u043e\u0442 \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0430\u043a\u0435\u0442\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u043c \u043a\u043e\u0434\u043e\u043c \u0438\u043b\u0438 \u0441\u0440\u0435\u0434\u043e\u0439 \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u043e\u0448\u0438\u0431\u043a\u0443. <\/p>\n<h2>3. \u0423\u0442\u0435\u0447\u043a\u0430 \u043f\u0430\u043c\u044f\u0442\u0438 \u0432 Rmarkdown::render<\/h2>\n<p>\u041f\u0440\u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043e\u0442\u0447\u0435\u043e\u0432 \u0432 PDF \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0430, \u0435\u0441\u043b\u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 \u043d\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u0430, \u0442\u043e \u0432\u0438\u0434\u043d\u043e \u043a\u0430\u043a \u043e\u043d \u043e\u0442\u044a\u0435\u0434\u0430\u0435\u0442 \u0432\u0441\u044e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c \u0438 \u043f\u0430\u0434\u0430\u0435\u0442. \u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043c\u044b \u0440\u0435\u0437\u0430\u043b\u0438 \u043e\u0442\u0447\u0435\u0442 \u043d\u0430 \u0447\u0430\u0441\u0442\u0438 \u0438 \u043f\u043e\u0442\u043e\u043c \u0438\u0445 \u0441\u043a\u043b\u0435\u0438\u0432\u0430\u043b\u0438. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 <a href=\"https:\/\/www.rdocumentation.org\/packages\/qpdf\/versions\/1.2.0\/topics\/qpdf\" rel=\"noopener noreferrer nofollow\">qpdf::pdf_combine<\/a>. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0441 \u0443\u0442\u0435\u0447\u043a\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u043e\u0431\u0441\u0443\u0436\u0434\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c <a href=\"https:\/\/stackoverflow.com\/questions\/39319558\/pandoc-rstudio-knitr-memory-leak\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>. \u041a\u0430\u043a\u043e\u0433\u043e-\u0442\u043e \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043d\u0430\u0439\u0442\u0438 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c, \u0445\u043e\u0442\u044f \u0441\u0438\u043b \u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0431\u044b\u043b\u043e \u043f\u043e\u0442\u0440\u0430\u0447\u0435\u043d\u043d\u043e \u043d\u0435\u043c\u0430\u043b\u043e.<\/p>\n<h2>4. Latex<\/h2>\n<p>\u0414\u043b\u044f \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f pdf \u043e\u0442\u0447\u0435\u0442\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 <a href=\"https:\/\/www.latex-project.org\/\" rel=\"noopener noreferrer nofollow\">Latex<\/a>. \u041d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d \u0434\u043b\u044f \u043e\u0442\u0447\u0435\u0442\u0430 \u0431\u044b\u043b \u0432\u0437\u044f\u0442 <a href=\"https:\/\/github.com\/iandol\/dotpandoc\/blob\/master\/templates\/custom.latex\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>. <\/p>\n<p>\u041a\u043e\u0434 \u043d\u0430 R \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043e\u0442\u0447\u0435\u0442\u0430 \u0441 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u043c Latex:<\/p>\n<pre><code class=\"r\">  rmarkdown::render(     rmd_input,     output_format = \"pdf_document\",     output_file = output_file,     output_dir = output_report_dir,     params = params,     output_options = list(       template = paste0(report_rmd_folder,                         \"\/assets\/custom.latex\"),       clean = TRUE     )   )<\/code><\/pre>\n<p>\u0422\u0430\u043a \u0436\u0435 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 \u0448\u0430\u043f\u043a\u0443 RMD \u0444\u0430\u0439\u043b\u0430 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043b\u044f \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430:<\/p>\n<pre><code class=\"r\">--- title: header-includes:   \\usepackage{graphicx}   \\usepackage{fancyhdr}   \\pagestyle{fancy}   \\color{ecbdarkblue}   \\color{ecbbgr}    % Head    \\fancyhead[C]{}   \\fancyhead[L]{}   \\fancyhead[R]{}    % Remove header line    \\renewcommand{\\headrulewidth}{0pt}    % Page margins    \\usepackage{geometry}   \\geometry{    a4paper,    left=30px,    top=10mm,    headsep=5mm,    right=50px    }    % Titles    \\usepackage{titlesec}   \\titlespacing\\section{0mm}{7pt plus 4pt minus 2pt}{28pt plus 2pt minus 2pt}   \\titlespacing\\subsection{6mm}{-7pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}   \\titlespacing\\subsubsection{6mm}{12pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}    % Section and subsection titles    \\sectionfont{\\fontfamily{phv}\\selectfont\\LARGE\\bfseries\\color{ecbdarkblue}}   \\subsectionfont{\\fontfamily{phv}\\selectfont\\normalsize\\mdseries\\color{white}}   \\subsubsectionfont{\\fontfamily{phv}\\selectfont\\scriptsize\\mdseries\\color{white}}   \\color{black}    % Line spacing    \\usepackage{setspace}   \\setstretch{0.6}    % Section color    \\usepackage{xcolor}   \\usepackage{framed}   \\colorlet{shadecolor}{ecbbgr}    % Footer    \\fancyfootoffset[R]{-2mm}   \\renewcommand{\\footrulewidth}{0.4pt}\\color{ecbdarkblue}   \\rfoot{\\vspace{0.5mm}\\Large\\color{ecbdarkblue}\\colorbox{ecbbgr}{ S \\color{white}\\thepage}}   \\cfoot{\\vspace{0.01mm}\\scriptsize\\bfseries\\hspace{420px} ECB \\\\ \\scriptsize\\bfseries\\color{black}\\hspace{390px} DG-S\/EA\/GBS\\\\  \\scriptsize\\bfseries\\color{ecbdarkblue}\\hspace{395px} `r format(Sys.Date(), format=\"%d %b %Y\")`}   \\lfoot{} output:   pdf_document:     keep_md: no     keep_tex: no     latex_engine: pdflatex     number_sections: false --- ```{r setup, include=FALSE} # some code here... ```<\/code><\/pre>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u044b Latex \u044f \u043d\u0435 \u0431\u0443\u0434\u0443 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c, \u0442\u0430\u043a \u043a\u0430\u043a \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u043a\u043e\u0434 \u0432 \u0442\u0435\u0445 \u0438\u043b\u0438 \u0438\u043d\u044b\u0445 \u0431\u043b\u043e\u043a\u0430\u0445 \u0438 \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a \u043d\u0430\u0434\u043e \u0435\u0433\u043e \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435. \u0412\u043e \u043c\u043d\u043e\u0433\u043e\u043c \u044f \u043e\u043f\u0438\u0440\u0430\u043b\u0441\u044f \u043d\u0430 <a href=\"https:\/\/www.overleaf.com\/learn\" rel=\"noopener noreferrer nofollow\">\u044d\u0442\u043e\u0442 \u0441\u0430\u0439\u0442<\/a> \u043a\u043e\u0433\u0434\u0430 \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043b \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442.<\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u0442\u0430\u043a \u0436\u0435 \u0433\u0438\u0431\u043a\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043a\u0430\u043a\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0443\u0442 \u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u0432 \u043e\u0442\u0447\u0435\u0442. \u042d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439: <\/p>\n<pre><code class=\"r\">knitr::opts_chunk$set(echo = FALSE,                       warning = FALSE,                       message = FALSE,                       error = TRUE)<\/code><\/pre>\n<p>\u041c\u043e\u0436\u043d\u043e \u044d\u0442\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0442\u0430\u043a \u0436\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0432 \u0448\u0430\u043f\u043a\u0435 chunk:<\/p>\n<pre><code class=\"r\">```{r our_chunk, eval = TRUE, results='asis', echo=FALSE, warning=FALSE, message=FALSE, error=TRUE}<\/code><\/pre>\n<h2>5. \u0417\u0430\u0433\u043b\u0443\u0448\u043a\u0438 \u0434\u043b\u044f \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u043f\u0440\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 Unit \u0442\u0435\u0441\u0442\u043e\u0432<\/h2>\n<p>\u0414\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u0432\u0443\u043d\u043a\u0446\u0438\u0439 \u0438\u0437 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 Python  \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 <strong>reticulate<\/strong>. <\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0437\u043e\u0432\u0430 \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<pre><code class=\"r\">get_python_func &lt;- function(param1) {   pm &lt;- reticulate::import(\"our_project.core.python_functions\")   return(pm$get_python_func(param1)) }<\/code><\/pre>\n<p>\u0422\u0435\u0441\u0442 &#8212; \u0437\u0430\u0433\u043b\u0443\u0448\u043a\u0430 \u0434\u043b\u044f \u0442\u0430\u043a\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<pre><code class=\"r\">test_that(\"get_python_func\", {<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-339398","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/339398","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=339398"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/339398\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=339398"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=339398"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=339398"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}