{"id":241,"date":"2022-10-02T16:08:58","date_gmt":"2022-10-02T07:08:58","guid":{"rendered":"https:\/\/best-biostatistics.com\/toukei-er\/entry\/network-analysis-with-network-package-in-r\/"},"modified":"2024-09-04T23:10:23","modified_gmt":"2024-09-04T14:10:23","slug":"network-analysis-with-network-package-in-r","status":"publish","type":"post","link":"https:\/\/best-biostatistics.com\/toukei-er\/entry\/network-analysis-with-network-package-in-r\/","title":{"rendered":"R \u3067\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u56f3\u3092\u66f8\u304f\u65b9\u6cd5"},"content":{"rendered":"\n<p>R \u306b\u304a\u3051\u308b\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u5206\u6790\u306e\u30d1\u30c3\u30b1\u30fc\u30b8 network \u306e\u7c21\u5358\u306a\u4f7f\u3044\u65b9\u3002<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\" id=\"network-\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\">network \u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n\n\n\n<p>\u307e\u305a\u7d71\u8a08\u30bd\u30d5\u30c8R\u306b\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u547c\u3073\u51fa\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span class=\"synIdentifier\">install.packages<\/span><span class=\"synSpecial\">(<\/span><span class=\"synConstant\">\"network\"<\/span><span class=\"synSpecial\">)<\/span>\n<span class=\"synPreProc\">library<\/span><span class=\"synSpecial\">(<\/span>network<span class=\"synSpecial\">)<\/span>\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u6e96\u5099\u3059\u308b\u30c7\u30fc\u30bf\">\u6e96\u5099\u3059\u308b\u30c7\u30fc\u30bf<\/h2>\n\n\n\n<p>\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u3064\u306a\u304c\u308a\u3042\u308a\u306a\u3057\u306e\u884c\u5217\u3092\u6e96\u5099\u3059\u308b\u3002<\/p>\n\n\n\n<p>network \u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u4ed8\u5c5e\u3057\u3066\u3044\u308b flo \u3092\u4f8b\u3068\u3057\u3066\u7528\u3044\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span class=\"synIdentifier\">data<\/span><span class=\"synSpecial\">(<\/span><span class=\"synConstant\">'flow\")<\/span>\n<\/code><\/pre>\n\n\n\n<p>flow \u306e\u5185\u5bb9\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u3082\u306e\u3060\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"748\" height=\"181\" src=\"https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2022\/10\/20221002154015.png\" alt=\"\" class=\"wp-image-1395\" title=\"\" srcset=\"https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2022\/10\/20221002154015.png 748w, https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2022\/10\/20221002154015-300x73.png 300w\" sizes=\"(max-width: 748px) 100vw, 748px\" \/><\/figure>\n\n\n\n<p><span itemscope=\"\" itemtype=\"http:\/\/schema.org\/Photograph\"><\/span><\/p>\n\n\n\n<p>\u884c\u3068\u5217\u306b\u540c\u3058\u8981\u7d20\uff08vertex\uff09\u304c\u4e26\u3073\u3001\u3064\u306a\u304c\u308a\uff08edge\uff09\u304c\u3042\u308b\u3082\u306e\u540c\u58eb\u304c\uff11\u3067\u3042\u308b\u3002<\/p>\n\n\n\n<p>\u3064\u306a\u304c\u308a\u304c\u306a\u3044\u3082\u306e\u540c\u58eb\u306f\uff10\u3067\u3042\u308b\u3002<\/p>\n\n\n\n<div id=\"biost-3781772474\" class=\"biost- biost-entity-placement\"><p style=\"text-align: center;\"><span style=\"font-size: 20px;\"><strong><a href=\"https:\/\/best-biostatistics.com\/kmhl\">\uff1e\uff1e\u3082\u3046\u7d71\u8a08\u3067\u60a9\u3080\u306e\u306f\u7d42\u308f\u308a\u306b\u3057\u307e\u305b\u3093\u304b\uff1f\u00a0<\/a><\/strong><\/span><\/p>\r\n<a href=\"https:\/\/best-biostatistics.com\/kmhl\"><img class=\"aligncenter wp-image-2794 size-full\" src=\"https:\/\/best-biostatistics.com\/wp\/wp-content\/uploads\/2023\/11\/bn_r_03.png\" alt=\"\" width=\"500\" height=\"327\" \/><\/a>\r\n<p style=\"text-align: center;\"><span style=\"color: #ff0000; font-size: 20px;\"><strong><span class=\"marker2\">\u21911\u4e07\u4eba\u4ee5\u4e0a\u306e\u533b\u7642\u5f93\u4e8b\u8005\u304c\u8cfc\u8aad\u4e2d<\/span><\/strong><\/span><\/p><\/div><h2 class=\"wp-block-heading\" id=\"\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u5206\u6790\u306e\u5b9f\u884c\">\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u5206\u6790\u306e\u5b9f\u884c<\/h2>\n\n\n\n<p>network \u30d1\u30c3\u30b1\u30fc\u30b8\u306e network() \u95a2\u6570\u3092\u9069\u7528\u3059\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nflo <span class=\"synStatement\">&lt;-<\/span> <span class=\"synIdentifier\">network<\/span><span class=\"synSpecial\">(<\/span>flo<span class=\"synSpecial\">)<\/span>\n<span class=\"synIdentifier\">summary<\/span><span class=\"synSpecial\">(<\/span>nflo<span class=\"synSpecial\">)<\/span>\n<\/code><\/pre>\n\n\n\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30b5\u30de\u30ea\u30fc\u304c\u51fa\u529b\u3055\u308c\u308b\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"635\" height=\"1024\" src=\"https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2022\/10\/20221002154421-635x1024.png\" alt=\"\" class=\"wp-image-1397\" title=\"\" srcset=\"https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2022\/10\/20221002154421-635x1024.png 635w, https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2022\/10\/20221002154421-186x300.png 186w, https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2022\/10\/20221002154421.png 640w\" sizes=\"(max-width: 635px) 100vw, 635px\" \/><\/figure>\n\n\n\n<p><span itemscope=\"\" itemtype=\"http:\/\/schema.org\/Photograph\"><\/span><\/p>\n\n\n\n<p>vertices \u304c\u9802\u70b9\u306e\u6570\u3002<\/p>\n\n\n\n<p>\u3053\u308c\u304c\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u69cb\u6210\u3059\u308b\u8981\u7d20\u3067\u3042\u308b\u3002<\/p>\n\n\n\n<p>directed = TRUE\u3067\u3042\u308b\u306e\u306f\u3001\u65b9\u5411\u6027\u3092\u52a0\u5473\u3057\u3066\u3044\u308b\u3068\u3044\u3046\u610f\u5473\u3002<\/p>\n\n\n\n<p>total edges = 40 \u3067\u3001\u3064\u306a\u304c\u308a\u304c40\u3042\u308b\u3068\u3044\u3046\u610f\u5473\u3067\u3042\u308b\u3002<\/p>\n\n\n\n<p>\u53cc\u65b9\u5411\u3092\uff12\u3064\u3068\u6570\u3048\u3066\u3044\u308b\u3002<\/p>\n\n\n\n<p>network density \u306f\u30010.1666667\u3068\u8a08\u7b97\u3055\u308c\u3066\u3044\u308b\u3002<\/p>\n\n\n\n<p>\u6700\u5f8c\u306b Network edgelist matrix \u304c\u51fa\u529b\u3055\u308c\u3066\u3044\u308b\u3002<\/p>\n\n\n\n<p>\u3069\u306e\u9802\u70b9\u540c\u58eb\u304c\u3064\u306a\u304c\u3063\u3066\u3044\u308b\u304b\u306e\u30ea\u30b9\u30c8\u3060\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u63cf\u753b\">\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u63cf\u753b<\/h2>\n\n\n\n<p>plot() \u3067\u3001\u56f3\u3092\u63cf\u753b\u3059\u308b\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span class=\"synIdentifier\">plot<\/span><span class=\"synSpecial\">(<\/span>nflo<span class=\"synSpecial\">)<\/span>\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"672\" height=\"672\" src=\"https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2022\/10\/20221002155014.png\" alt=\"\" class=\"wp-image-1398\" title=\"\" srcset=\"https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2022\/10\/20221002155014.png 672w, https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2022\/10\/20221002155014-300x300.png 300w, https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2022\/10\/20221002155014-150x150.png 150w\" sizes=\"(max-width: 672px) 100vw, 672px\" \/><\/figure>\n\n\n\n<p><span itemscope=\"\" itemtype=\"http:\/\/schema.org\/Photograph\"><\/span><\/p>\n\n\n\n<p>\u9802\u70b9\u306b\u540d\u524d\u3092\u5165\u308c\u305f\u3044\u5834\u5408\u306f\u3001displaylabels = TRUE \u3068\u3059\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span class=\"synIdentifier\">plot<\/span><span class=\"synSpecial\">(<\/span>nflo<span class=\"synSpecial\">,<\/span> displaylabels<span class=\"synStatement\">=<\/span><span class=\"synConstant\">TRUE<\/span><span class=\"synSpecial\">)<\/span>\n<\/code><\/pre>\n\n\n\n<p>\u3059\u308b\u3068\u3001\u9802\u70b9\u306b\u540d\u524d\u304c\u4ed8\u304f\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"672\" height=\"672\" src=\"https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2022\/10\/20221002155255.png\" alt=\"\" class=\"wp-image-1399\" title=\"\" srcset=\"https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2022\/10\/20221002155255.png 672w, https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2022\/10\/20221002155255-300x300.png 300w, https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2022\/10\/20221002155255-150x150.png 150w\" sizes=\"(max-width: 672px) 100vw, 672px\" \/><\/figure>\n\n\n\n<p><span itemscope=\"\" itemtype=\"http:\/\/schema.org\/Photograph\"><\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u65b9\u5411\u6027\u304c\u306a\u3044\u3064\u306a\u304c\u308a\u306e\u5834\u5408\">\u65b9\u5411\u6027\u304c\u306a\u3044\u3064\u306a\u304c\u308a\u306e\u5834\u5408<\/h2>\n\n\n\n<p>\u3064\u306a\u304c\u308a\u306b\u306f\u3001\u65b9\u5411\u6027\u304c\u306a\u304f\u3001\u76f8\u95a2\u3068\u3044\u3046\u3053\u3068\u3067\u3042\u308c\u3070\u3001directed = FALSE \u3092\u6307\u5b9a\u3059\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nflo1 <span class=\"synStatement\">&lt;-<\/span> <span class=\"synIdentifier\">network<\/span><span class=\"synSpecial\">(<\/span>flo<span class=\"synSpecial\">,<\/span> directed<span class=\"synStatement\">=<\/span><span class=\"synConstant\">FALSE<\/span><span class=\"synSpecial\">)<\/span>\n<span class=\"synIdentifier\">summary<\/span><span class=\"synSpecial\">(<\/span>nflo1<span class=\"synSpecial\">)<\/span>\n<span class=\"synIdentifier\">plot<\/span><span class=\"synSpecial\">(<\/span>nflo1<span class=\"synSpecial\">,<\/span> displaylabels<span class=\"synStatement\">=<\/span><span class=\"synConstant\">TRUE<\/span><span class=\"synSpecial\">)<\/span>\n<\/code><\/pre>\n\n\n\n<p>\u3059\u308b\u3068 total edges = 20\u306b\u6e1b\u5c11\u3059\u308b\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"635\" height=\"1024\" src=\"https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2022\/10\/20221002155506-635x1024.png\" alt=\"\" class=\"wp-image-1400\" title=\"\" srcset=\"https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2022\/10\/20221002155506-635x1024.png 635w, https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2022\/10\/20221002155506-186x300.png 186w, https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2022\/10\/20221002155506.png 640w\" sizes=\"(max-width: 635px) 100vw, 635px\" \/><\/figure>\n\n\n\n<p><span itemscope=\"\" itemtype=\"http:\/\/schema.org\/Photograph\"><\/span><\/p>\n\n\n\n<p>\u56f3\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u306b\u306a\u308a\u3001\u3064\u306a\u304c\u308a\u306e\u4e21\u7aef\u306e\u77e2\u5370\u982d\u304c\u306a\u304f\u306a\u308b\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"672\" height=\"672\" src=\"https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2022\/10\/20221002155618.png\" alt=\"\" class=\"wp-image-1401\" title=\"\" srcset=\"https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2022\/10\/20221002155618.png 672w, https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2022\/10\/20221002155618-300x300.png 300w, https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2022\/10\/20221002155618-150x150.png 150w\" sizes=\"(max-width: 672px) 100vw, 672px\" \/><\/figure>\n\n\n\n<p><span itemscope=\"\" itemtype=\"http:\/\/schema.org\/Photograph\"><\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u307e\u3068\u3081\">\u307e\u3068\u3081<\/h2>\n\n\n\n<p>R \u306e\u30d1\u30c3\u30b1\u30fc\u30b8 network \u3092\u7528\u3044\u3066\u3001\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u56f3\u306e\u63cf\u753b\u3092\u3084\u3063\u3066\u307f\u305f\u3002<\/p>\n\n\n\n<p>\u3064\u306a\u304c\u308a\u3092\u793a\u3059\u884c\u5217\u306e\u30c7\u30fc\u30bf\u304c\u3042\u308c\u3070\u3001\u7c21\u5358\u306b\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u56f3\u306f\u63cf\u753b\u3067\u304d\u308b\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u53c2\u8003\u6587\u732e\">\u53c2\u8003\u6587\u732e<\/h2>\n\n\n\n<p><a href=\"https:\/\/www.jstatsoft.org\/article\/view\/v024i02\">network: A Package for Managing Relational Data in R | Journal of Statistical Software<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>R \u306b\u304a\u3051\u308b\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u5206\u6790\u306e\u30d1\u30c3\u30b1\u30fc\u30b8 network \u306e\u7c21\u5358\u306a\u4f7f\u3044\u65b9\u3002<\/p>\n","protected":false},"author":2,"featured_media":1401,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[5,62],"tags":[],"class_list":["post-241","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-r","category-62"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/best-biostatistics.com\/toukei-er\/wp-content\/uploads\/2022\/10\/20221002155618.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/posts\/241","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/comments?post=241"}],"version-history":[{"count":1,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/posts\/241\/revisions"}],"predecessor-version":[{"id":1402,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/posts\/241\/revisions\/1402"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/media\/1401"}],"wp:attachment":[{"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/media?parent=241"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/categories?post=241"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/best-biostatistics.com\/toukei-er\/wp-json\/wp\/v2\/tags?post=241"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}