{"id":263587,"date":"2015-08-14T16:44:02","date_gmt":"2015-08-14T12:44:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=263587"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=263587","title":{"rendered":"\u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0438 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u0435\u0442\u0435\u0439 \u043d\u0430 R, \u0447\u0430\u0441\u0442\u044c 2"},"content":{"rendered":"<p>       \u0412 <a href=\"http:\/\/\">\u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438<\/a>:  <\/p>\n<ul>\n<li>\u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0435\u0442\u0435\u0439: \u0437\u0430\u0447\u0435\u043c? \u043a\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c?<\/li>\n<li>\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438<\/li>\n<li>best practices \u2014 \u044d\u0441\u0442\u0435\u0442\u0438\u043a\u0430 \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c<\/li>\n<li>\u0444\u043e\u0440\u043c\u0430\u0442\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430<\/li>\n<li>\u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043d\u0430\u0431\u043e\u0440\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445<\/li>\n<li>\u043d\u0430\u0447\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u0441 igraph<\/li>\n<\/ul>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438: \u0446\u0432\u0435\u0442\u0430 \u0438 \u0448\u0440\u0438\u0444\u0442\u044b \u0432 \u0433\u0440\u0430\u0444\u0438\u043a\u0430\u0445 R.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>\u041a\u0440\u0430\u0442\u043a\u043e\u0435 \u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0435 I: \u0446\u0432\u0435\u0442\u0430 \u0432 \u0433\u0440\u0430\u0444\u0438\u043a\u0430\u0445 R<\/h4>\n<p>  \u0426\u0432\u0435\u0442\u0430 \u2014 \u044d\u0442\u043e \u043a\u0440\u0430\u0441\u0438\u0432\u043e, \u043d\u043e \u043a\u0443\u0434\u0430 \u0432\u0430\u0436\u043d\u0435\u0435 \u0442\u043e, \u0447\u0442\u043e \u043e\u043d\u0438 \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u0442\u044c \u0442\u0438\u043f\u044b \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u0433\u0440\u0430\u0434\u0430\u0446\u0438\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430. \u0412 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 R \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <i>\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0446\u0432\u0435\u0442\u043e\u0432<\/i>, <i>RGB<\/i> \u0438\u043b\u0438 <i>\u0448\u0435\u0441\u0442\u043d\u0430\u0434\u0446\u0430\u0442\u0435\u0440\u0438\u0447\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f<\/i>. \u0412 \u043f\u0440\u043e\u0441\u0442\u043e\u043c \u0431\u0430\u0437\u043e\u0432\u043e\u043c \u0433\u0440\u0430\u0444\u0438\u043a\u0435 R \u043d\u0438\u0436\u0435 <code>x<\/code> \u0438 <code>y<\/code> \u2014 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0442\u043e\u0447\u0435\u043a, <code>pch<\/code> \u2014 \u0441\u0438\u043c\u0432\u043e\u043b \u0434\u043b\u044f \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0442\u043e\u0447\u0435\u043a, <code>cex<\/code> \u2014 \u0440\u0430\u0437\u043c\u0435\u0440 \u0442\u043e\u0447\u043a\u0438 \u0438 <code>col<\/code> \u2014 \u0446\u0432\u0435\u0442. \u0427\u0442\u043e\u0431\u044b \u0443\u0437\u043d\u0430\u0442\u044c, \u043a\u0430\u043a\u0438\u0435 \u0431\u044b\u0432\u0430\u044e\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432 \u0432 R, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>?par<\/code>.  <\/p>\n<pre><code class=\"python\">plot(x=1:10, y=rep(5,10), pch=19, cex=3, col=&quot;dark red&quot;) points(x=1:10, y=rep(6, 10), pch=19, cex=3, col=&quot;557799&quot;) points(x=1:10, y=rep(4, 10), pch=19, cex=3, col=rgb(.25, .5, .3)) <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/48f\/c00\/6fe\/48fc006fe2834aa5a70034b894ec2100.png\" width=\"30%\"\/><\/p>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e, RGB \u0437\u0434\u0435\u0441\u044c \u0432\u0430\u0440\u044c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043e\u0442 0 \u0434\u043e 1. \u042d\u0442\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0434\u043b\u044f R, \u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0438 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u043e\u0442 0 \u0434\u043e 255, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>rgb(10, 100, 100, maxColorValue=255)<\/code>.<\/p>\n<p>  \u041c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e\u0441\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>alpha<\/code> (\u043e\u0442 0 \u0434\u043e 1):  <\/p>\n<pre><code class=\"python\">plot(x=1:5, y=rep(5,5), pch=19, cex=12, col=rgb(.25, .5, .3, alpha=.5), xlim=c(0,6))   <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/f99\/607\/a12\/f99607a127d741ee9ffcdf79dbb9e93e.png\" width=\"30%\"\/><\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0448\u0435\u0441\u0442\u043d\u0430\u0434\u0446\u0430\u0442\u0435\u0440\u0438\u0447\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0446\u0432\u0435\u0442\u0430, \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e\u0441\u0442\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <code>adjustcolor<\/code> \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u0430 <code>grDevices<\/code>. \u0420\u0430\u0434\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043a\u0440\u0430\u0441\u0438\u043c \u0444\u043e\u043d \u0433\u0440\u0430\u0444\u0438\u043a\u0430 \u0432 \u0441\u0435\u0440\u044b\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>par()<\/code> \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0433\u0440\u0430\u0444\u0438\u043a\u0438.   <\/p>\n<pre><code class=\"python\">par(bg=&quot;gray40&quot;) col.tr &lt;- grDevices::adjustcolor(&quot;557799&quot;, alpha=0.7) plot(x=1:5, y=rep(5,5), pch=19, cex=12, col=col.tr, xlim=c(0,6))  <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/49b\/d95\/bca\/49bd95bca35b4559a8049a7cbff14ca0.png\" width=\"30%\"\/><\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0446\u0432\u0435\u0442\u043e\u0432, \u0432\u043e\u0442 \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0445 \u0432\u0441\u0435:  <\/p>\n<pre><code class=\"python\">colors()                          # List all named colors grep(&quot;blue&quot;, colors(), value=T)   # Colors that have &quot;blue&quot; in the name <\/code><\/pre>\n<p>  \u0412 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043d\u0442\u0440\u0430\u0441\u0442\u043d\u044b\u0445 \u0446\u0432\u0435\u0442\u043e\u0432, \u0438\u043b\u0438 \u043e\u0442\u0442\u0435\u043d\u043a\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0446\u0432\u0435\u0442\u0430. \u0412 R \u0435\u0441\u0442\u044c \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0430\u043b\u0438\u0442\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u043e\u0436\u0435\u0442 \u044d\u0442\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:  <\/p>\n<pre><code class=\"python\">pal1 &lt;- heat.colors(5, alpha=1)   #  5 colors from the heat palette, opaque pal2 &lt;- rainbow(5, alpha=.5)      #  5 colors from the heat palette, transparent plot(x=1:10, y=1:10, pch=19, cex=5, col=pal1) <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/8be\/21e\/2c7\/8be21e2c736c4c758b366977040ba4eb.png\" width=\"30%\"\/><\/p>\n<pre><code class=\"python\">plot(x=1:10, y=1:10, pch=19, cex=5, col=pal2) <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/949\/1ec\/e61\/9491ece619f34e458fbfc9d5e472d35f.png\" width=\"30%\"\/><\/p>\n<p>  \u041c\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>colorRampPalette<\/code>. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e <code>colorRampPalette<\/code> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <i>\u0444\u0443\u043d\u043a\u0446\u0438\u044e<\/i>, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u0442\u043e\u043b\u044c\u043a\u0438\u0445 \u0446\u0432\u0435\u0442\u043e\u0432 \u0438\u0437 \u044d\u0442\u043e\u0439 \u043f\u0430\u043b\u0438\u0442\u0440\u044b, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0443\u0436\u043d\u043e.  <\/p>\n<pre><code class=\"python\">palf &lt;- colorRampPalette(c(&quot;gray80&quot;, &quot;dark red&quot;))  plot(x=10:1, y=1:10, pch=19, cex=5, col=palf(10)) <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/af8\/8e2\/16a\/af88e216ab8148af8a37d6657580f61a.png\" width=\"30%\"\/><\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e\u0441\u0442\u044c \u0432 <code>colorRampPalette<\/code>, \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>alpha=TRUE<\/code>:  <\/p>\n<pre><code class=\"python\">palf &lt;- colorRampPalette(c(rgb(1,1,1, .2),rgb(.8,0,0, .7)), alpha=TRUE) plot(x=10:1, y=1:10, pch=19, cex=5, col=palf(10))  <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/afc\/bdb\/abc\/afcbdbabc23240d8a8f792e99af57380.png\" width=\"30%\"\/><\/p>\n<p>  \u041d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u0445\u043e\u0440\u043e\u0448\u0435\u0439 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0438 \u0446\u0432\u0435\u0442\u043e\u0432 \u2014 \u043d\u0435\u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u043f\u0430\u043b\u0438\u0442\u0440\u044b R \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u044b. \u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0440\u0435\u0448\u0430\u044e\u0442 \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u044b:  <\/p>\n<pre><code class=\"python\"># If you don't have R ColorBrewer already, you will need to install it: install.packages(&quot;RColorBrewer&quot;) library(RColorBrewer) display.brewer.all() <\/code><\/pre>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u043f\u0430\u043a\u0435\u0442\u0435 \u043e\u0434\u043d\u0430 \u0433\u043b\u0430\u0432\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u2014 <code>brewer.pal<\/code>. \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0435\u0439 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f, \u043d\u0443\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u043f\u0430\u043b\u0438\u0442\u0440\u0443 \u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0446\u0432\u0435\u0442\u043e\u0432. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0437\u0433\u043b\u044f\u043d\u0435\u043c \u043d\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0430\u043b\u0438\u0442\u0440\u044b <code>RColorBrewer<\/code>:  <\/p>\n<pre><code class=\"python\">display.brewer.pal(8, &quot;Set3&quot;) <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/af8\/a28\/4d0\/af8a284d0a0a4824b0db0a6be4680319.png\" width=\"30%\"\/><\/p>\n<pre><code class=\"python\">display.brewer.pal(8, &quot;Spectral&quot;) <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/348\/bc5\/0e0\/348bc50e0b6f4806ba51f652c3422ecb.png\" width=\"30%\"\/><\/p>\n<pre><code class=\"python\">display.brewer.pal(8, &quot;Blues&quot;) <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/d33\/f5f\/a45\/d33f5fa450ad4e60bd656d9accfd6d20.png\" width=\"30%\"\/><\/p>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043b\u0438\u0442\u0440 <code>RColorBrewer<\/code> \u0432 \u0433\u0440\u0430\u0444\u0430\u0445:  <\/p>\n<pre><code class=\"javascript\">pal3 &lt;- brewer.pal(10, &quot;Set3&quot;)  plot(x=10:1, y=10:1, pch=19, cex=4, col=pal3) <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/abc\/892\/0ea\/abc8920ea74b40a0bc387b37debf6ba9.png\" width=\"30%\"\/><\/p>\n<h4>\u041a\u0440\u0430\u0442\u043a\u043e\u0435 \u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0435 II: \u0448\u0440\u0438\u0444\u0442\u044b \u0432 \u0433\u0440\u0430\u0444\u0438\u043a\u0430\u0445 R<\/h4>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u0430\u0437\u043d\u044b\u0445 \u0448\u0440\u0438\u0444\u0442\u043e\u0432 \u0432 \u0433\u0440\u0430\u0444\u0438\u043a\u0430\u0445 R \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0443\u0441\u0438\u043b\u0438\u0439. \u042d\u0442\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 Windows, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 Mac \u0438 Linux, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u043c\u043e\u0433\u0443\u0442 \u0431\u043b\u0430\u0433\u043e\u043f\u043e\u043b\u0443\u0447\u043d\u043e \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u0440\u0430\u0437\u0434\u0435\u043b.<\/p>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0448\u0440\u0438\u0444\u0442\u044b \u0438\u0437 \u041e\u0421 \u0432 R, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u043f\u0430\u043a\u0435\u0442\u043e\u043c <code>extrafont<\/code>:  <\/p>\n<pre><code class=\"javascript\">install.packages(&quot;extrafont&quot;) library(extrafont)  # Import system fonts - may take a while. font_import()  fonts() # See what font families are available to you now. loadfonts(device = &quot;win&quot;) # use device = &quot;pdf&quot; for pdf plot output.  <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0448\u0440\u0438\u0444\u0442\u044b \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b, \u0438 \u043c\u043e\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0442\u0430\u043a\u043e\u0435:  <\/p>\n<pre><code class=\"javascript\">library(extrafont) plot(net, vertex.size=30) plot(net, vertex.size=30, vertex.label.family=&quot;Arial Black&quot; ) <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/943\/172\/57a\/94317257a03f40a981d534fce2a85d14.png\" width=\"75%\"\/><\/p>\n<p>  \u041a\u043e\u0433\u0434\u0430 \u0432\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0435 \u0433\u0440\u0430\u0444\u0438\u043a\u0438 \u043a\u0430\u043a PDF-\u0444\u0430\u0439\u043b\u044b, \u0442\u043e\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0448\u0440\u0438\u0444\u0442\u044b:  <\/p>\n<pre><code class=\"javascript\"># First you may have to let R know where to find ghostscript on your machine: Sys.setenv(R_GSCMD = &quot;C:\/Program Files\/gs\/gs9.10\/bin\/gswin64c.exe&quot;)  # pdf() will send all the plots we output before dev.off() to a pdf file:  pdf(file=&quot;ArialBlack.pdf&quot;) plot(net, vertex.size=30, vertex.label.family=&quot;Arial Black&quot; ) dev.off()  embed_fonts(&quot;ArialBlack.pdf&quot;, outfile=&quot;ArialBlack_embed.pdf&quot;) <\/code><\/pre>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/263947\/\"> http:\/\/habrahabr.ru\/post\/263947\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       \u0412 <a href=\"http:\/\/\">\u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438<\/a>:  <\/p>\n<ul>\n<li>\u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0435\u0442\u0435\u0439: \u0437\u0430\u0447\u0435\u043c? \u043a\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c?<\/li>\n<li>\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438<\/li>\n<li>best practices \u2014 \u044d\u0441\u0442\u0435\u0442\u0438\u043a\u0430 \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c<\/li>\n<li>\u0444\u043e\u0440\u043c\u0430\u0442\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430<\/li>\n<li>\u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043d\u0430\u0431\u043e\u0440\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445<\/li>\n<li>\u043d\u0430\u0447\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u0441 igraph<\/li>\n<\/ul>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438: \u0446\u0432\u0435\u0442\u0430 \u0438 \u0448\u0440\u0438\u0444\u0442\u044b \u0432 \u0433\u0440\u0430\u0444\u0438\u043a\u0430\u0445 R.  <\/p>\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-263587","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/263587","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=263587"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/263587\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=263587"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=263587"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=263587"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}